namespace: change -> git.grassecon.net/kamikazechaser/vise

This commit is contained in:
Mohamed Sohail 2023-04-17 12:56:56 +00:00
parent 194522fd95
commit d8ef336919
Signed by: kamikazechaser
GPG Key ID: 7DD45520C01CD85D
31 changed files with 274 additions and 288 deletions

View File

@ -156,7 +156,7 @@ Multipage outputs, like listings, are handled using the _sink_ output constraint
### Languages support
**Not yet implemeennted**
**Not yet implemented**
Language for rendering is determined at the top-level state.

View File

@ -13,10 +13,9 @@ import (
"github.com/alecthomas/participle/v2"
"github.com/alecthomas/participle/v2/lexer"
"git.defalsify.org/vise/vm"
"git.grassecon.net/kamikazechaser/vise/vm"
)
// Asm assembles bytecode from the vise assembly mini-language.
type Asm struct {
Instructions []*Instruction `@@*`
@ -373,9 +372,7 @@ func Parse(s string, w io.Writer) (int, error) {
return 0, err
}
batch := Batcher{
}
batch := Batcher{}
var rn int
for _, v := range ast.Instructions {

View File

@ -7,10 +7,9 @@ import (
"log"
"testing"
"git.defalsify.org/vise/vm"
"git.grassecon.net/kamikazechaser/vise/vm"
)
func TestParserInit(t *testing.T) {
var b []byte
b = vm.NewLine(b, vm.HALT, nil, nil, nil)

View File

@ -3,7 +3,7 @@ package asm
import (
"fmt"
"git.defalsify.org/vise/vm"
"git.grassecon.net/kamikazechaser/vise/vm"
)
// BatchCode defines quasi-opcodes that expand to mulitple individual vm instructions.

View File

@ -3,10 +3,9 @@ package asm
import (
"testing"
"git.defalsify.org/vise/vm"
"git.grassecon.net/kamikazechaser/vise/vm"
)
func TestMenuInterpreter(t *testing.T) {
m := NewMenuProcessor()
err := m.Add("DOWN", "0", "inky", "foo")

View File

@ -6,11 +6,11 @@ import (
"log"
"os"
"git.defalsify.org/vise/asm"
"git.grassecon.net/kamikazechaser/vise/asm"
)
func main() {
if (len(os.Args) < 2) {
if len(os.Args) < 2 {
os.Exit(1)
}
fp := os.Args[1]

View File

@ -2,14 +2,14 @@ package main
import (
"fmt"
"os"
"io/ioutil"
"os"
"git.defalsify.org/vise/vm"
"git.grassecon.net/kamikazechaser/vise/vm"
)
func main() {
if (len(os.Args) < 2) {
if len(os.Args) < 2 {
os.Exit(1)
}
fp := os.Args[1]

View File

@ -4,7 +4,7 @@ import (
"fmt"
"os"
"git.defalsify.org/vise/testdata"
"git.grassecon.net/kamikazechaser/vise/testdata"
)
func main() {

View File

@ -6,7 +6,7 @@ import (
"fmt"
"os"
"git.defalsify.org/vise/engine"
"git.grassecon.net/kamikazechaser/vise/engine"
)
func main() {

View File

@ -3,9 +3,9 @@ package engine
import (
"context"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
)
// NewDefaultEngine is a convenience function to instantiate a filesystem-backed engine with no output constraints.

View File

@ -6,11 +6,11 @@ import (
"io"
"log"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/render"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/state"
"git.defalsify.org/vise/vm"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/render"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
"git.grassecon.net/kamikazechaser/vise/vm"
)
// Config globally defines behavior of all components driven by the engine.

View File

@ -8,10 +8,10 @@ import (
"path"
"testing"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/state"
"git.defalsify.org/vise/testdata"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
"git.grassecon.net/kamikazechaser/vise/testdata"
)
var (
@ -137,7 +137,6 @@ func TestEngineExecInvalidInput(t *testing.T) {
rs := NewFsWrapper(dataDir, &st)
ca := cache.NewCache().WithCacheSize(1024)
en := NewEngine(Config{
Root: "root",
}, &st, &rs, ca, ctx)

View File

@ -8,9 +8,9 @@ import (
"strings"
"testing"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
)
func TestLoopTop(t *testing.T) {

View File

@ -4,8 +4,8 @@ import (
"context"
"io"
"git.defalsify.org/vise/persist"
"git.defalsify.org/vise/resource"
"git.grassecon.net/kamikazechaser/vise/persist"
"git.grassecon.net/kamikazechaser/vise/resource"
)
// RunPersisted performs a single vm execution from client input using a persisted state.

View File

@ -6,9 +6,9 @@ import (
"os"
"testing"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/persist"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/persist"
"git.grassecon.net/kamikazechaser/vise/state"
)
func TestPersist(t *testing.T) {

View File

@ -11,10 +11,10 @@ import (
testdataloader "github.com/peteole/testdata-loader"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/engine"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/engine"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
)
const (

View File

@ -11,10 +11,10 @@ import (
testdataloader "github.com/peteole/testdata-loader"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/engine"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/engine"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
)
var (

View File

@ -9,10 +9,10 @@ import (
testdataloader "github.com/peteole/testdata-loader"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/engine"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/engine"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
)
var (

2
go.mod
View File

@ -1,4 +1,4 @@
module git.defalsify.org/vise
module git.grassecon.net/kamikazechaser/vise
go 1.20

View File

@ -5,10 +5,11 @@ import (
"log"
"path"
"path/filepath"
"github.com/fxamacker/cbor/v2"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/state"
)
// FsPersister is an implementation of Persister that saves state to the file system.

View File

@ -7,9 +7,9 @@ import (
"reflect"
"testing"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/state"
"git.defalsify.org/vise/vm"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/state"
"git.grassecon.net/kamikazechaser/vise/vm"
)
func TestSerializeState(t *testing.T) {

View File

@ -1,8 +1,8 @@
package persist
import (
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/state"
)
// Persister interface defines the methods needed for a component that can store the execution state to a storage location.
@ -14,4 +14,3 @@ type Persister interface {
GetState() *state.State // Get the currently loaded State object.
GetMemory() cache.Memory // Get the currently loaded Cache object.
}

View File

@ -7,8 +7,8 @@ import (
"strings"
"text/template"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/resource"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/resource"
)
// Page exectues output rendering into pages constrained by size.
@ -151,7 +151,6 @@ func(pg *Page) RenderTemplate(sym string, values map[string]string, idx uint16)
return "", err
}
b := bytes.NewBuffer([]byte{})
err = tp.Execute(b, values)
if err != nil {
@ -332,4 +331,3 @@ func(pg *Page) render(sym string, values map[string]string, idx uint16) (string,
}
return r, nil
}

View File

@ -3,10 +3,9 @@ package render
import (
"testing"
"git.defalsify.org/vise/cache"
"git.grassecon.net/kamikazechaser/vise/cache"
)
func TestPageCurrentSize(t *testing.T) {
t.Skip("usage is not in use, and it is unclear how it should be calculated")
ca := cache.NewCache()

View File

@ -5,9 +5,9 @@ import (
"fmt"
"testing"
"git.defalsify.org/vise/state"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/cache"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
)
type TestSizeResource struct {
@ -172,7 +172,6 @@ lala poo
1:foo the foo
2:go to bar`
if r != expect {
t.Fatalf("expected:\n\t%x\ngot:\n\t%x\n", expect, r)
}

View File

@ -1,7 +1,7 @@
package resource
import (
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/state"
)
type StateResource struct {

View File

@ -3,7 +3,7 @@ package resource
import (
"testing"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/state"
)
func TestStateResourceInit(t *testing.T) {

View File

@ -8,7 +8,7 @@ import (
testdataloader "github.com/peteole/testdata-loader"
"git.defalsify.org/vise/vm"
"git.grassecon.net/kamikazechaser/vise/vm"
)
type genFunc func() error
@ -177,7 +177,6 @@ func Generate() (string, error) {
return dir, err
}
// Generate outputs bytecode, templates and content symbols to a specified directory.
//
// The directory must exist, and must not have been used already in the same code execution.

View File

@ -5,8 +5,8 @@ import (
"fmt"
"regexp"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/state"
)
var (
@ -16,7 +16,6 @@ var (
ctrlRegex = regexp.MustCompile(ctrlRegexStr)
symRegexStr = "^[a-zA-Z0-9][a-zA-Z0-9_]+$"
symRegex = regexp.MustCompile(symRegexStr)
)
// CheckInput validates the given byte string as client input.

View File

@ -5,10 +5,10 @@ import (
"fmt"
"log"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/render"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/render"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
)
// Vm holds sub-components mutated by the vm execution.
@ -167,7 +167,6 @@ func(vm *Vm) RunDeadCheck(b []byte, ctx context.Context) ([]byte, error) {
return b, nil
}
log.Printf("no code remaining but not terminating")
location, _ := vm.st.Where()
if location == "" {

View File

@ -7,10 +7,10 @@ import (
"log"
"testing"
"git.defalsify.org/vise/cache"
"git.defalsify.org/vise/render"
"git.defalsify.org/vise/resource"
"git.defalsify.org/vise/state"
"git.grassecon.net/kamikazechaser/vise/cache"
"git.grassecon.net/kamikazechaser/vise/render"
"git.grassecon.net/kamikazechaser/vise/resource"
"git.grassecon.net/kamikazechaser/vise/state"
)
var dynVal = "three"
@ -456,7 +456,6 @@ func TestRunReturn(t *testing.T) {
}
}
func TestRunLoadInput(t *testing.T) {
st := state.NewState(5)
rs := TestResource{}