rename package cfg to conf

This commit is contained in:
Vadym Slizov
2021-02-13 23:54:34 +02:00
parent 9d12f1d162
commit 367eff9de6
14 changed files with 503 additions and 503 deletions

View File

@@ -1,4 +1,4 @@
package cfg
package conf
import (
"github.com/z7zmey/php-parser/pkg/errors"

View File

@@ -10,7 +10,7 @@ Package usage example:
"log"
"os"
"github.com/z7zmey/php-parser/pkg/cfg"
"github.com/z7zmey/php-parser/pkg/conf"
"github.com/z7zmey/php-parser/pkg/errors"
"github.com/z7zmey/php-parser/pkg/parser"
"github.com/z7zmey/php-parser/pkg/version"
@@ -24,12 +24,12 @@ Package usage example:
var parserErrors []*errors.Error
errorHandler := func(e *errors.Error) {
parserErrors = append(parserErrors, e)
parsmakeerErrors = append(parserErrors, e)
}
// Parse
rootNode, err := parser.Parse(src, cfg.Config{
rootNode, err := parser.Parse(src, conf.Config{
Version: &version.Version{Major: 5, Minor: 6},
ErrorHandlerFunc: errorHandler,
})

View File

@@ -7,7 +7,7 @@ import (
"github.com/z7zmey/php-parser/internal/php7"
"github.com/z7zmey/php-parser/internal/scanner"
"github.com/z7zmey/php-parser/pkg/ast"
"github.com/z7zmey/php-parser/pkg/cfg"
"github.com/z7zmey/php-parser/pkg/conf"
"github.com/z7zmey/php-parser/pkg/version"
)
@@ -28,7 +28,7 @@ type Parser interface {
GetRootNode() ast.Vertex
}
func Parse(src []byte, config cfg.Config) (ast.Vertex, error) {
func Parse(src []byte, config conf.Config) (ast.Vertex, error) {
var parser Parser
if config.Version == nil {

View File

@@ -7,13 +7,13 @@ import (
"github.com/z7zmey/php-parser/internal/php5"
"github.com/z7zmey/php-parser/internal/scanner"
"github.com/z7zmey/php-parser/pkg/ast"
"github.com/z7zmey/php-parser/pkg/cfg"
"github.com/z7zmey/php-parser/pkg/conf"
"github.com/z7zmey/php-parser/pkg/version"
"github.com/z7zmey/php-parser/pkg/visitor/printer"
)
func parsePhp5(src string) ast.Vertex {
config := cfg.Config{
config := conf.Config{
Version: &version.Version{
Major: 5,
Minor: 6,

View File

@@ -8,7 +8,7 @@ import (
"github.com/z7zmey/php-parser/internal/php7"
"github.com/z7zmey/php-parser/internal/scanner"
"github.com/z7zmey/php-parser/pkg/ast"
"github.com/z7zmey/php-parser/pkg/cfg"
"github.com/z7zmey/php-parser/pkg/conf"
"github.com/z7zmey/php-parser/pkg/version"
"github.com/z7zmey/php-parser/pkg/visitor/printer"
)
@@ -30,7 +30,7 @@ abstract class Bar extends Baz
// parse
config := cfg.Config{
config := conf.Config{
Version: &version.Version{
Major: 7,
Minor: 4,
@@ -68,7 +68,7 @@ abstract class Bar extends Baz
}
func parse(src string) ast.Vertex {
config := cfg.Config{
config := conf.Config{
Version: &version.Version{
Major: 7,
Minor: 4,