Skip to content

Commit

Permalink
Rename spec package to spec/grammar package
Browse files Browse the repository at this point in the history
  • Loading branch information
nihei9 committed May 26, 2022
1 parent def1459 commit 4c0f7eb
Show file tree
Hide file tree
Showing 29 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
spec/clexspec.json
spec/grammar/clexspec.json
2 changes: 1 addition & 1 deletion cmd/vartan-go/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

mldriver "github.com/nihei9/maleeni/driver"
"github.com/nihei9/vartan/driver"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/vartan/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

verr "github.com/nihei9/vartan/error"
"github.com/nihei9/vartan/grammar"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/vartan/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"

"github.com/nihei9/vartan/driver"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/vartan/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"text/template"

"github.com/nihei9/vartan/grammar"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion driver/conflict_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/nihei9/vartan/grammar"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

func TestParserWithConflicts(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion driver/lac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

"github.com/nihei9/vartan/grammar"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

func TestParserWithLAC(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion driver/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/nihei9/vartan/grammar"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

func termNode(kind string, text string, children ...*Node) *Node {
Expand Down
2 changes: 1 addition & 1 deletion driver/semantic_action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/nihei9/vartan/grammar"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

type testSemAct struct {
Expand Down
2 changes: 1 addition & 1 deletion driver/spec.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package driver

import "github.com/nihei9/vartan/spec"
import spec "github.com/nihei9/vartan/spec/grammar"

type grammarImpl struct {
g *spec.CompiledGrammar
Expand Down
2 changes: 1 addition & 1 deletion driver/syntax_error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

"github.com/nihei9/vartan/grammar"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

func TestParserWithSyntaxErrors(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion driver/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"strings"
"text/template"

"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

//go:embed parser.go
Expand Down
2 changes: 1 addition & 1 deletion driver/token_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"io"

mldriver "github.com/nihei9/maleeni/driver"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

type vToken struct {
Expand Down
2 changes: 1 addition & 1 deletion grammar/first_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"testing"

"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

type first struct {
Expand Down
2 changes: 1 addition & 1 deletion grammar/grammar.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
mlcompiler "github.com/nihei9/maleeni/compiler"
mlspec "github.com/nihei9/maleeni/spec"
verr "github.com/nihei9/vartan/error"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

type astActionEntry struct {
Expand Down
2 changes: 1 addition & 1 deletion grammar/grammar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"

verr "github.com/nihei9/vartan/error"
"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

func TestGrammarBuilderOK(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion grammar/lalr1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"testing"

"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

func TestGenLALR1Automaton(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion grammar/lr0_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"testing"

"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

type expectedLRState struct {
Expand Down
2 changes: 1 addition & 1 deletion grammar/parsing_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"sort"

"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

type ActionType string
Expand Down
2 changes: 1 addition & 1 deletion grammar/parsing_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"testing"

"github.com/nihei9/vartan/spec"
spec "github.com/nihei9/vartan/spec/grammar"
)

type expectedState struct {
Expand Down
2 changes: 1 addition & 1 deletion spec/description.go → spec/grammar/description.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spec
package grammar

type Terminal struct {
Number int `json:"number"`
Expand Down
2 changes: 1 addition & 1 deletion spec/grammar.go → spec/grammar/grammar.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spec
package grammar

import mlspec "github.com/nihei9/maleeni/spec"

Expand Down
4 changes: 2 additions & 2 deletions spec/lexer.go → spec/grammar/lexer.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//go:generate maleeni compile lexspec.json -o clexspec.json
//go:generate maleeni-go clexspec.json --package spec
//go:generate maleeni-go clexspec.json --package grammar

package spec
package grammar

import (
_ "embed"
Expand Down
2 changes: 1 addition & 1 deletion spec/lexer_test.go → spec/grammar/lexer_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spec
package grammar

import (
"strings"
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion spec/parser.go → spec/grammar/parser.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spec
package grammar

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion spec/parser_test.go → spec/grammar/parser_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spec
package grammar

import (
"strings"
Expand Down
2 changes: 1 addition & 1 deletion spec/syntax_error.go → spec/grammar/syntax_error.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package spec
package grammar

type SyntaxError struct {
message string
Expand Down
2 changes: 1 addition & 1 deletion spec/vartan_lexer.go → spec/grammar/vartan_lexer.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4c0f7eb

Please sign in to comment.