Skip to content

Commit

Permalink
Added go.mod and sorted imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Kasyanov committed Feb 3, 2023
1 parent 0e5c3c5 commit 3842396
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 14 deletions.
3 changes: 2 additions & 1 deletion evaluator/smalltalkEvaluator_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package evaluator

import (
"testing"

"github.com/SealNTibbers/GotalkInterpreter/testutils"
"github.com/SealNTibbers/GotalkInterpreter/treeNodes"
"testing"
)

func TestArrayEvaluation(t *testing.T) {
Expand Down
3 changes: 3 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/SealNTibbers/GotalkInterpreter

go 1.18
3 changes: 2 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package main
import (
"bufio"
"fmt"
. "github.com/SealNTibbers/GotalkInterpreter/evaluator"
"os"
"os/signal"
"strings"
"syscall"

. "github.com/SealNTibbers/GotalkInterpreter/evaluator"
)

// SetupCloseHandler creates a 'listener' on a new goroutine which will notify the
Expand Down
7 changes: 4 additions & 3 deletions parser/smalltalkParser.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package parser

import (
"github.com/SealNTibbers/GotalkInterpreter/talkio"
"github.com/SealNTibbers/GotalkInterpreter/scanner"
"github.com/SealNTibbers/GotalkInterpreter/treeNodes"
"strconv"
"strings"

"github.com/SealNTibbers/GotalkInterpreter/scanner"
"github.com/SealNTibbers/GotalkInterpreter/talkio"
"github.com/SealNTibbers/GotalkInterpreter/treeNodes"
)

type Parser struct {
Expand Down
3 changes: 2 additions & 1 deletion parser/smalltalkParser_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package parser

import (
"testing"

"github.com/SealNTibbers/GotalkInterpreter/scanner"
"github.com/SealNTibbers/GotalkInterpreter/testutils"
"github.com/SealNTibbers/GotalkInterpreter/treeNodes"
"testing"
)

func TestNumberParser(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion scanner/smalltalkScanner_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package scanner

import (
"testing"

"github.com/SealNTibbers/GotalkInterpreter/talkio"
"github.com/SealNTibbers/GotalkInterpreter/testutils"
"testing"
)

func TestScanNumber(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion talkio/stringReader_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package talkio

import (
"github.com/SealNTibbers/GotalkInterpreter/testutils"
"io"
"testing"

"github.com/SealNTibbers/GotalkInterpreter/testutils"
)

func TestReadRune(t *testing.T) {
Expand Down
11 changes: 6 additions & 5 deletions treeNodes/nodes.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package treeNodes

import (
"github.com/SealNTibbers/GotalkInterpreter/scanner"
"sort"

"github.com/SealNTibbers/GotalkInterpreter/scanner"
)

type ProgramNodeInterface interface {
Expand Down Expand Up @@ -114,7 +115,7 @@ func (m *SequenceNode) SetRightBar(rightBar int64) {
}

func (m *SequenceNode) GetVariables() []string {
result := [] string {}
result := []string{}
for _, statement := range m.statements {
result = append(result, statement.GetVariables()...)
}
Expand Down Expand Up @@ -273,8 +274,8 @@ func (v *VariableNode) GetName() string {
}

func (m *VariableNode) GetVariables() []string {
result := [] string {}
return append(result,m.Token.ValueOfToken())
result := []string{}
return append(result, m.Token.ValueOfToken())
}

type NodeWithRreceiverInterface interface {
Expand Down Expand Up @@ -411,7 +412,7 @@ func (m *BlockNode) GetVariables() []string {
sort.Strings(result)
for _, arg := range m.arguments {
localVariable := arg.GetVariables()[0]
index := sort.SearchStrings(result,localVariable)
index := sort.SearchStrings(result, localVariable)
result = append(result[:index], result[index+1:]...)
}
sort.Strings(result)
Expand Down
3 changes: 2 additions & 1 deletion treeNodes/nodesEvaluation.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package treeNodes

import (
"fmt"
"github.com/SealNTibbers/GotalkInterpreter/scanner"
"strconv"

"github.com/SealNTibbers/GotalkInterpreter/scanner"
)

type Scope struct {
Expand Down

0 comments on commit 3842396

Please sign in to comment.