Skip to content

Commit

Permalink
Restructured project part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaumgarten committed Jan 14, 2020
1 parent 09280d8 commit 096afb8
Show file tree
Hide file tree
Showing 65 changed files with 60 additions and 105 deletions.
4 changes: 2 additions & 2 deletions cmd/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"path"
"strings"

"github.com/dbaumgarten/yodk/nolol"
"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/nolol"
"github.com/dbaumgarten/yodk/pkg/parser"

"github.com/spf13/cobra"
)
Expand Down
8 changes: 4 additions & 4 deletions cmd/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
"strconv"
"strings"

"github.com/dbaumgarten/yodk/nolol"
"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/testing"
"github.com/dbaumgarten/yodk/pkg/nolol"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/dbaumgarten/yodk/pkg/testing"

"github.com/abiosoft/ishell"
"github.com/dbaumgarten/yodk/vm"
"github.com/dbaumgarten/yodk/pkg/vm"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import (
"path"
"strings"

"github.com/dbaumgarten/yodk/nolol"
"github.com/dbaumgarten/yodk/pkg/nolol"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/spf13/cobra"
)

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

"github.com/dbaumgarten/yodk/langserver"
"github.com/dbaumgarten/yodk/pkg/langserver"
"github.com/spf13/cobra"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/optimize.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"path"
"strings"

"github.com/dbaumgarten/yodk/optimizers"
"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/optimizers"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"os"
"path/filepath"

"github.com/dbaumgarten/yodk/testing"
"github.com/dbaumgarten/yodk/pkg/testing"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package cmd
import (
"fmt"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/spf13/cobra"
)

Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright © 2019 NAME HERE <EMAIL ADDRESS>
// Copyright © 2019 dbaumgarten

package main

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"reflect"
"testing"

"github.com/dbaumgarten/yodk/jsonrpc2"
"github.com/dbaumgarten/yodk/pkg/jsonrpc2"
)

var logRPC = flag.Bool("logrpc", false, "Enable jsonrpc2 communication logging")
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions langserver/diagnostics.go → pkg/langserver/diagnostics.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import (
"log"
"strings"

"github.com/dbaumgarten/yodk/nolol"
"github.com/dbaumgarten/yodk/pkg/nolol"

"github.com/dbaumgarten/yodk/lsp"
"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/lsp"
"github.com/dbaumgarten/yodk/pkg/parser"
)

func (s *LangServer) Diagnose(ctx context.Context, uri lsp.DocumentURI, text string) {
Expand Down
6 changes: 3 additions & 3 deletions langserver/formatting.go → pkg/langserver/formatting.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"path/filepath"
"strings"

"github.com/dbaumgarten/yodk/lsp"
"github.com/dbaumgarten/yodk/nolol"
"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/lsp"
"github.com/dbaumgarten/yodk/pkg/nolol"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/pmezard/go-difflib/difflib"
)

Expand Down
4 changes: 2 additions & 2 deletions langserver/server.go → pkg/langserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"os"
"runtime"

"github.com/dbaumgarten/yodk/jsonrpc2"
"github.com/dbaumgarten/yodk/lsp"
"github.com/dbaumgarten/yodk/pkg/jsonrpc2"
"github.com/dbaumgarten/yodk/pkg/lsp"
)

type LangServer struct {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lsp/client.go → pkg/lsp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"context"
"encoding/json"

"github.com/dbaumgarten/yodk/jsonrpc2"
"github.com/dbaumgarten/yodk/pkg/jsonrpc2"
)

type Client interface {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lsp/general.go → pkg/lsp/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

package lsp

import "github.com/dbaumgarten/yodk/jsonrpc2"
import "github.com/dbaumgarten/yodk/pkg/jsonrpc2"

type CancelParams struct {
/**
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lsp/protocol.go → pkg/lsp/protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"context"
"log"

"github.com/dbaumgarten/yodk/jsonrpc2"
"github.com/dbaumgarten/yodk/pkg/jsonrpc2"
)

func canceller(ctx context.Context, conn *jsonrpc2.Conn, req *jsonrpc2.Request) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion lsp/server.go → pkg/lsp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"context"
"encoding/json"

"github.com/dbaumgarten/yodk/jsonrpc2"
"github.com/dbaumgarten/yodk/pkg/jsonrpc2"
)

type Server interface {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion nolol/ast.go → pkg/nolol/ast.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package nolol

import "github.com/dbaumgarten/yodk/parser"
import "github.com/dbaumgarten/yodk/pkg/parser"

// Program represents a complete programm
type Program struct {
Expand Down
4 changes: 2 additions & 2 deletions nolol/converter.go → pkg/nolol/converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package nolol
import (
"fmt"

"github.com/dbaumgarten/yodk/optimizers"
"github.com/dbaumgarten/yodk/pkg/optimizers"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
)

// special error that is emitted if a nolol if can not be converted to an inline yolol-if
Expand Down
6 changes: 3 additions & 3 deletions nolol/nolol_test.go → pkg/nolol/nolol_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package nolol_test
import (
"testing"

"github.com/dbaumgarten/yodk/nolol"
"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/vm"
"github.com/dbaumgarten/yodk/pkg/nolol"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/dbaumgarten/yodk/pkg/vm"
)

var testProg = `
Expand Down
2 changes: 1 addition & 1 deletion nolol/parser.go → pkg/nolol/parser.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package nolol

import (
"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
)

// Parser pasres a nolol-program
Expand Down
2 changes: 1 addition & 1 deletion nolol/printer.go → pkg/nolol/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nolol
import (
"fmt"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
)

// Printer can generate the nolol-code corresponding to a nolol ast
Expand Down
2 changes: 1 addition & 1 deletion nolol/tokenizer.go → pkg/nolol/tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package nolol
import (
"regexp"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
)

// NewNololTokenizer creates a Yolol-Tokenizer that is modified to also accept Nolol-specific tokens
Expand Down
2 changes: 1 addition & 1 deletion nolol/visitor.go → pkg/nolol/visitor.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package nolol

import (
"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
)

// Accept is used to implement Acceptor
Expand Down
2 changes: 1 addition & 1 deletion optimizers/optimizer.go → pkg/optimizers/optimizer.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package optimizers

import "github.com/dbaumgarten/yodk/parser"
import "github.com/dbaumgarten/yodk/pkg/parser"

// Optimizer is the common interface for all optimizers
type Optimizer interface {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package optimizers
import (
"testing"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/testdata"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/dbaumgarten/yodk/pkg/testdata"
)

func TestOptimizers(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package optimizers
import (
"fmt"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/vm"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/dbaumgarten/yodk/pkg/vm"
"github.com/shopspring/decimal"
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package optimizers
import (
"testing"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/testdata"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/dbaumgarten/yodk/pkg/testdata"
)

func TestStaticExpressions(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"strings"
"testing"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/testdata"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/dbaumgarten/yodk/pkg/testdata"
)

func TestGetNextVarName(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
)

// VariableNameOptimizer replaces variable names with sorter names
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions parser/parser_test.go → pkg/parser/parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package parser_test
import (
"testing"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/testdata"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/dbaumgarten/yodk/pkg/testdata"
)

func TestParser(t *testing.T) {
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions parser/printer_test.go → pkg/parser/printer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package parser_test
import (
"testing"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/testdata"
"github.com/dbaumgarten/yodk/pkg/parser"
"github.com/dbaumgarten/yodk/pkg/testdata"
)

func TestGenerator(t *testing.T) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion parser/tokenizer_test.go → pkg/parser/tokenizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"testing"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
)

func TestTokenizer(t *testing.T) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion testdata/dataset.go → pkg/testdata/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"strings"

"github.com/dbaumgarten/yodk/vm"
"github.com/dbaumgarten/yodk/pkg/vm"
"github.com/shopspring/decimal"
)

Expand Down
6 changes: 3 additions & 3 deletions testing/test.go → pkg/testing/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
"strings"
"sync"

"github.com/dbaumgarten/yodk/nolol"
"github.com/dbaumgarten/yodk/pkg/nolol"

"github.com/shopspring/decimal"
yaml "gopkg.in/yaml.v2"

"github.com/dbaumgarten/yodk/vm"
"github.com/dbaumgarten/yodk/pkg/vm"
)

// Test defines a test-run
Expand Down Expand Up @@ -67,7 +67,7 @@ func Parse(file []byte, absolutePath string) (Test, error) {
if script.Iterations == 0 {
test.Scripts[i].Iterations = 1
}
script.AbsolutePath = absolutePath
test.Scripts[i].AbsolutePath = absolutePath
}
return test, err
}
Expand Down
2 changes: 1 addition & 1 deletion testing/test_test.go → pkg/testing/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package testing_test
import (
"testing"

thistesting "github.com/dbaumgarten/yodk/testing"
thistesting "github.com/dbaumgarten/yodk/pkg/testing"
)

func TestTestcase(t *testing.T) {
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion vm/coordinator_test.go → pkg/vm/coordinator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vm_test
import (
"testing"

"github.com/dbaumgarten/yodk/vm"
"github.com/dbaumgarten/yodk/pkg/vm"
)

func TestCoordinatedExecution(t *testing.T) {
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion vm/yolol_vm.go → pkg/vm/yolol_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/shopspring/decimal"

"github.com/dbaumgarten/yodk/parser"
"github.com/dbaumgarten/yodk/pkg/parser"
)

var errAbortLine = fmt.Errorf("")
Expand Down
2 changes: 1 addition & 1 deletion vm/yolol_vm_test.go → pkg/vm/yolol_vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package vm_test
import (
"testing"

"github.com/dbaumgarten/yodk/testdata"
"github.com/dbaumgarten/yodk/pkg/testdata"
)

func TestOperators(t *testing.T) {
Expand Down
Loading

0 comments on commit 096afb8

Please sign in to comment.