Changed repository import paths
This commit is contained in:
parent
9d43ef75ee
commit
23052aa6f0
@ -2,9 +2,9 @@ package analyzer
|
||||
|
||||
import "fmt"
|
||||
import "math"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/integer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/integer"
|
||||
|
||||
type strictness int; const (
|
||||
// Structural equivalence, but named types are treated as opaque and are
|
||||
|
@ -1,6 +1,6 @@
|
||||
package analyzer
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
var primitiveTypes = map[string] entity.Type {
|
||||
"Int": &entity.TypeWord { Acc: entity.AccessPublic, Signed: true },
|
||||
|
@ -1,7 +1,7 @@
|
||||
package analyzer
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *Tree) analyzeExpression (
|
||||
into entity.Type,
|
||||
|
@ -1,8 +1,8 @@
|
||||
package analyzer
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
// All expression analysis routines must take in the type they are being
|
||||
// assigned to and return an error if they can't be assigned to it. if the type
|
||||
|
@ -1,7 +1,7 @@
|
||||
package analyzer
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *Tree) analyzeFunction (
|
||||
pos errors.Position,
|
||||
|
@ -1,8 +1,8 @@
|
||||
package analyzer
|
||||
|
||||
import "unicode/utf16"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *Tree) analyzeLiteralInt (
|
||||
into entity.Type,
|
||||
|
@ -1,8 +1,8 @@
|
||||
package analyzer
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
|
||||
// analyzeMethod analyzes a method that is directly owned by the specified type.
|
||||
|
@ -1,7 +1,7 @@
|
||||
package analyzer
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *Tree) assembleSignatureMap (signature *entity.Signature) (*entity.Signature, error) {
|
||||
signature.ArgumentMap = make(map[string] *entity.Declaration)
|
||||
|
@ -1,6 +1,6 @@
|
||||
package analyzer
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
// scopeContextManager is a stack of scopeContexts allowing multiple stacks of
|
||||
// scopes to be managed at the same time in case the analysis of one scoped
|
||||
|
@ -3,10 +3,10 @@ package analyzer
|
||||
import "testing"
|
||||
import "strings"
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/parser/fspl"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/parser/fspl"
|
||||
|
||||
func testStringErr (
|
||||
test *testing.T,
|
||||
|
@ -1,9 +1,9 @@
|
||||
package analyzer
|
||||
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/parser/fspl"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/parser/fspl"
|
||||
|
||||
// Tree is a semantic tree. It contains the same constructs as the syntax tree,
|
||||
// but with their semantic information filled in.
|
||||
|
@ -1,8 +1,8 @@
|
||||
package analyzer
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *Tree) analyzeTypedef (
|
||||
pos errors.Position,
|
||||
|
@ -2,10 +2,10 @@ package main
|
||||
|
||||
import "os"
|
||||
import "path/filepath"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/cli"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/compiler"
|
||||
import ferrors "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/cli"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/compiler"
|
||||
import ferrors "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
func main () {
|
||||
// instantiate the compiler
|
||||
|
@ -8,14 +8,14 @@ import "errors"
|
||||
import "os/exec"
|
||||
import "path/filepath"
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/analyzer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/parser/fspl"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/parser/meta"
|
||||
import ferrors "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator/native"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/analyzer"
|
||||
import "git.tebibyte.media/fspl/fspl/parser/fspl"
|
||||
import "git.tebibyte.media/fspl/fspl/parser/meta"
|
||||
import ferrors "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/generator/native"
|
||||
|
||||
type Compiler struct {
|
||||
Resolver
|
||||
|
@ -6,7 +6,7 @@ import "io/fs"
|
||||
import "errors"
|
||||
import "strings"
|
||||
import "path/filepath"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
// Resolver turns addresses into absolute filepaths.
|
||||
type Resolver struct {
|
||||
|
@ -2,7 +2,7 @@ package entity
|
||||
|
||||
import "fmt"
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
// Expression is any construct that can be evaluated.
|
||||
type Expression interface {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package entity
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
// LiteralInt specifies an integer value. It can be assigned to any type that is
|
||||
// derived from an integer or a float, as long as the value fo the literal can
|
||||
|
@ -6,7 +6,7 @@ import "unicode"
|
||||
import "unicode/utf8"
|
||||
import "path/filepath"
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
// Metadata represents a module metadata file.
|
||||
type Metadata struct {
|
||||
|
@ -3,7 +3,7 @@ package entity
|
||||
import "fmt"
|
||||
import "unicode"
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
// Signature is a function or method signature that is used in functions,
|
||||
// methods, and specifying interface behaviors. It defines the type of a
|
||||
|
@ -3,7 +3,7 @@ package entity
|
||||
import "fmt"
|
||||
import "encoding/base64"
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
// Key globally indexes top level entities in contexts where modules matter.
|
||||
type Key struct {
|
||||
|
@ -2,7 +2,7 @@ package entity
|
||||
|
||||
import "fmt"
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
// Type is any type notation.
|
||||
type Type interface {
|
||||
|
@ -1,7 +1,7 @@
|
||||
package errors
|
||||
|
||||
import "testing"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/testcommon"
|
||||
import "git.tebibyte.media/fspl/fspl/testcommon"
|
||||
|
||||
func testString (test *testing.T, correct string, got string) {
|
||||
if got != correct {
|
||||
|
@ -2,9 +2,9 @@ package generator
|
||||
|
||||
import "fmt"
|
||||
import "errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/analyzer"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/analyzer"
|
||||
|
||||
func (this *generator) generateAssignment (assignment *entity.Assignment) (llvm.Value, error) {
|
||||
destination, err := this.generateExpressionLoc(assignment.Location)
|
||||
|
@ -2,8 +2,8 @@ package generator
|
||||
|
||||
import "fmt"
|
||||
import "errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
type loopEntry struct {
|
||||
value llvm.Value
|
||||
|
@ -1,7 +1,7 @@
|
||||
package generator
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *generator) generateSlice (ty entity.Type, data llvm.Value, length llvm.Value) (llvm.Value, error) {
|
||||
irType, err := this.generateType(ty)
|
||||
|
@ -1,9 +1,9 @@
|
||||
package generator
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/analyzer"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/analyzer"
|
||||
|
||||
func (this *generator) generateVariableLoc (variable *entity.Variable) (llvm.Value, error) {
|
||||
return this.blockManager.variable(variable.Declaration)
|
||||
|
@ -1,8 +1,8 @@
|
||||
package generator
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
type resultMode int; const (
|
||||
resultModeAny resultMode = iota
|
||||
|
@ -2,9 +2,9 @@ package generator
|
||||
|
||||
import "fmt"
|
||||
import "errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/analyzer"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/analyzer"
|
||||
|
||||
func (this *generator) generateCallVal (call *entity.Call) (llvm.Value, error) {
|
||||
function, err := this.function(entity.Key {
|
||||
|
@ -1,9 +1,9 @@
|
||||
package generator
|
||||
|
||||
// import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
// import "git.tebibyte.media/sashakoshka/fspl/analyzer"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
// import "git.tebibyte.media/fspl/fspl/analyzer"
|
||||
|
||||
func (this *generator) generateBlock (block *entity.Block, mode resultMode) (llvm.Value, bool, error) {
|
||||
if len(block.Steps) == 0 { return nil, false, nil }
|
||||
|
@ -1,7 +1,7 @@
|
||||
package generator
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *generator) generateFunction (
|
||||
function *entity.Function,
|
||||
|
@ -2,9 +2,9 @@ package generator
|
||||
|
||||
import "sort"
|
||||
import "errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/analyzer"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/analyzer"
|
||||
|
||||
var errNotFound = errors.New("entity not found")
|
||||
|
||||
|
@ -2,9 +2,9 @@ package generator
|
||||
|
||||
import "fmt"
|
||||
import "errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/analyzer"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/analyzer"
|
||||
|
||||
func (this *generator) generateLiteralInt (literal *entity.LiteralInt) (llvm.Value, error) {
|
||||
irType, err := this.generateType(analyzer.ReduceToBase(literal.Type()))
|
||||
|
@ -2,7 +2,7 @@
|
||||
// This is accomplished using several conditionally compiled source files.
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
// NativeTarget returns a target describing the current system.
|
||||
func NativeTarget () generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
// this may not be accurate, can't find info online about amd64p32
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
return generator.Target {
|
||||
|
@ -1,6 +1,6 @@
|
||||
package native
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/generator"
|
||||
import "git.tebibyte.media/fspl/fspl/generator"
|
||||
|
||||
func nativeTarget () generator.Target {
|
||||
// FIXME: golang doesn't discern between 32/64 bit wasm so we assume 64
|
||||
|
@ -3,12 +3,12 @@ package generator
|
||||
import "testing"
|
||||
import "strings"
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/analyzer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/testcommon"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/parser/fspl"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/analyzer"
|
||||
import "git.tebibyte.media/fspl/fspl/testcommon"
|
||||
import "git.tebibyte.media/fspl/fspl/parser/fspl"
|
||||
|
||||
func testString (test *testing.T, correct string, input string) {
|
||||
address := entity.Address("main.fspl")
|
||||
|
@ -1,8 +1,8 @@
|
||||
package generator
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *generator) generateTypedef (
|
||||
def *entity.Typedef,
|
||||
|
@ -3,8 +3,8 @@ package generator
|
||||
import "fmt"
|
||||
import "errors"
|
||||
import "strings"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/llvm"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/llvm"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *generator) generateTypeIndex () (*llvm.TypeInt, error) {
|
||||
ty, err := this.typedef(entity.Key {
|
||||
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
||||
module git.tebibyte.media/sashakoshka/fspl
|
||||
module git.tebibyte.media/fspl/fspl
|
||||
|
||||
go 1.19
|
||||
|
||||
|
@ -5,7 +5,7 @@ import "io"
|
||||
import "fmt"
|
||||
import "bufio"
|
||||
import "unicode"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
// TokenKind is an enumeration of all tokens the FSPL compiler recognizes.
|
||||
type TokenKind int; const (
|
||||
|
@ -3,7 +3,7 @@ package lexer
|
||||
import "fmt"
|
||||
import "testing"
|
||||
import "strings"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
func tok (kind TokenKind, value string) Token {
|
||||
return Token {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package fsplParser
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
var descriptionExpression = "expression"
|
||||
var startTokensExpression = []lexer.TokenKind {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package fsplParser
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
func (this *treeParser) parseLiteralInt () (*entity.LiteralInt, error) {
|
||||
err := this.Expect(lexer.Int)
|
||||
|
@ -1,8 +1,8 @@
|
||||
package fsplParser
|
||||
|
||||
import "strconv"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
var descriptionSignature = "signature"
|
||||
var startTokensSignature = []lexer.TokenKind { lexer.LBracket }
|
||||
|
@ -2,8 +2,8 @@ package fsplParser
|
||||
|
||||
import "io"
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/parser"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/parser"
|
||||
|
||||
// parser parses tokens from a lexer into syntax entities, which it places into
|
||||
// a tree.
|
||||
|
@ -3,9 +3,9 @@ package fsplParser
|
||||
import "io"
|
||||
import "testing"
|
||||
import "strings"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/testcommon"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/testcommon"
|
||||
|
||||
func testString (test *testing.T, correct string, input string) {
|
||||
testStringInternal(test, correct, input, false)
|
||||
|
@ -1,8 +1,8 @@
|
||||
package fsplParser
|
||||
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
var descriptionTopLevel = "typedef, function, or method"
|
||||
var startTokensTopLevel = []lexer.TokenKind {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package fsplParser
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
// Tree represents a parsed abstract syntax tree. It has no constructor and its
|
||||
// zero value can be used safely.
|
||||
|
@ -1,9 +1,9 @@
|
||||
package fsplParser
|
||||
|
||||
import "strconv"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
var descriptionType = "type"
|
||||
var startTokensType = []lexer.TokenKind {
|
||||
|
@ -3,10 +3,10 @@ package metaParser
|
||||
import "io"
|
||||
import "fmt"
|
||||
import "github.com/google/uuid"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/parser"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/entity"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/parser"
|
||||
import "git.tebibyte.media/fspl/fspl/entity"
|
||||
|
||||
// Tree represents a parsed metadata file. It has no constructor and its zero
|
||||
// value can be used safely.
|
||||
|
@ -3,9 +3,9 @@ package metaParser
|
||||
import "io"
|
||||
import "testing"
|
||||
import "strings"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/testcommon"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/testcommon"
|
||||
|
||||
func testString (test *testing.T, correct string, input string) {
|
||||
ast := Tree { }
|
||||
|
@ -1,8 +1,8 @@
|
||||
package parser
|
||||
|
||||
import "fmt"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/lexer"
|
||||
import "git.tebibyte.media/sashakoshka/fspl/errors"
|
||||
import "git.tebibyte.media/fspl/fspl/lexer"
|
||||
import "git.tebibyte.media/fspl/fspl/errors"
|
||||
|
||||
// Parser is an embeddable type that contains parsing utilities. It is used to
|
||||
// build more specialized parsers.
|
||||
|
Loading…
Reference in New Issue
Block a user