瀏覽代碼

рефакторинг структуры пакетов после чтения гайда

p.kushnir 10 年之前
父節點
當前提交
155b149d3c

+ 0 - 0
fw/XevDemo1.oxf → XevDemo1.oxf


+ 0 - 0
fw/XevDemo2.oxf → XevDemo2.oxf


+ 0 - 0
fw/XevDemo3.oxf → XevDemo3.oxf


+ 0 - 0
fw/XevDemo4.oxf → XevDemo4.oxf


+ 2 - 2
cp/module/module.go

@@ -1,8 +1,8 @@
 package module
 
 import (
-	"cp/node"
-	"cp/object"
+	"fw/cp/node"
+	"fw/cp/object"
 	"ypk/assert"
 )
 

+ 4 - 4
cp/node/class.go

@@ -1,10 +1,10 @@
 package node
 
 import (
-	"cp/constant/enter"
-	"cp/constant/operation"
-	"cp/object"
-	"cp/statement"
+	"fw/cp/constant/enter"
+	"fw/cp/constant/operation"
+	"fw/cp/object"
+	"fw/cp/statement"
 )
 
 type EnterNode interface {

+ 2 - 2
cp/node/node.go

@@ -1,8 +1,8 @@
 package node
 
 import (
-	"cp/constant"
-	"cp/object"
+	"fw/cp/constant"
+	"fw/cp/object"
 )
 
 type Node interface {

+ 1 - 1
fw/domain.go → domain.go

@@ -1,7 +1,7 @@
 package main
 
 import (
-	"rt2/context"
+	"fw/rt2/context"
 	"ypk/assert"
 )
 

+ 6 - 6
fw/fw.go → fw.go

@@ -2,12 +2,12 @@ package main
 
 import (
 	"fmt"
-	"rt2/context"
-	"rt2/frame"
-	"rt2/module"
-	"rt2/nodeframe"
-	_ "rt2/rules"
-	"rt2/scope"
+	"fw/rt2/context"
+	"fw/rt2/frame"
+	"fw/rt2/module"
+	"fw/rt2/nodeframe"
+	_ "fw/rt2/rules"
+	"fw/rt2/scope"
 	"ypk/assert"
 )
 

+ 4 - 4
rt2/context/ctx.go

@@ -1,10 +1,10 @@
 package context
 
 const (
-	STACK    = "rt2/frame"
-	SCOPE    = "rt2/scope"
-	MOD      = "rt2/module"
-	UNIVERSE = "rt2/ctx"
+	STACK    = "fw/rt2/frame"
+	SCOPE    = "fw/rt2/scope"
+	MOD      = "fw/rt2/module"
+	UNIVERSE = "fw/rt2/ctx"
 )
 
 type Domain interface {

+ 2 - 2
rt2/decision/table.go

@@ -1,8 +1,8 @@
 package decision
 
 import (
-	"cp/node"
-	"rt2/frame"
+	"fw/cp/node"
+	"fw/rt2/frame"
 )
 
 var (

+ 1 - 1
rt2/frame/frame.go

@@ -1,7 +1,7 @@
 package frame
 
 import (
-	"rt2/context"
+	"fw/rt2/context"
 )
 
 type WAIT int

+ 1 - 1
rt2/frame/stdFrame.go

@@ -2,7 +2,7 @@ package frame
 
 import (
 	"container/list"
-	"rt2/context"
+	"fw/rt2/context"
 	"ypk/assert"
 )
 

+ 3 - 3
rt2/module/ml.go

@@ -1,10 +1,10 @@
 package module
 
 import (
-	mod "cp/module"
+	mod "fw/cp/module"
+	"fw/rt2/context"
+	"fw/xev"
 	"os"
-	"rt2/context"
-	"xev"
 	"ypk/assert"
 )
 

+ 4 - 4
rt2/nodeframe/frame.go

@@ -1,12 +1,12 @@
 package nodeframe
 
 import (
-	"cp/node"
 	"fmt"
+	"fw/cp/node"
+	"fw/rt2/context"
+	"fw/rt2/decision"
+	"fw/rt2/frame"
 	"reflect"
-	"rt2/context"
-	"rt2/decision"
-	"rt2/frame"
 	"ypk/assert"
 )
 

+ 6 - 6
rt2/rules/assign.go

@@ -1,14 +1,14 @@
 package rules
 
 import (
-	"cp/node"
-	"cp/statement"
 	"fmt"
+	"fw/cp/node"
+	"fw/cp/statement"
+	"fw/rt2/context"
+	"fw/rt2/frame"
+	"fw/rt2/nodeframe"
+	"fw/rt2/scope"
 	"reflect"
-	"rt2/context"
-	"rt2/frame"
-	"rt2/nodeframe"
-	"rt2/scope"
 )
 
 func assignSeq(f frame.Frame) (seq frame.Sequence, ret frame.WAIT) {

+ 4 - 4
rt2/rules/call.go

@@ -1,10 +1,10 @@
 package rules
 
 import (
-	"cp/node"
-	"rt2/frame"
-	mod "rt2/module"
-	"rt2/nodeframe"
+	"fw/cp/node"
+	"fw/rt2/frame"
+	mod "fw/rt2/module"
+	"fw/rt2/nodeframe"
 )
 
 /**

+ 5 - 5
rt2/rules/enter.go

@@ -1,11 +1,11 @@
 package rules
 
 import (
-	"cp/node"
-	"rt2/context"
-	"rt2/frame"
-	"rt2/nodeframe"
-	"rt2/scope"
+	"fw/cp/node"
+	"fw/rt2/context"
+	"fw/rt2/frame"
+	"fw/rt2/nodeframe"
+	"fw/rt2/scope"
 	"ypk/assert"
 )
 

+ 3 - 3
rt2/rules/if.go

@@ -1,11 +1,11 @@
 package rules
 
 import (
-	"cp/node"
 	"fmt"
+	"fw/cp/node"
+	"fw/rt2/frame"
+	"fw/rt2/nodeframe"
 	"reflect"
-	"rt2/frame"
-	"rt2/nodeframe"
 )
 
 func ifExpr(f frame.Frame) (seq frame.Sequence, ret frame.WAIT) {

+ 7 - 7
rt2/rules/op.go

@@ -1,15 +1,15 @@
 package rules
 
 import (
-	"cp/constant/operation"
-	"cp/node"
-	"cp/object"
 	"fmt"
+	"fw/cp/constant/operation"
+	"fw/cp/node"
+	"fw/cp/object"
+	"fw/rt2/context"
+	"fw/rt2/frame"
+	"fw/rt2/nodeframe"
+	"fw/rt2/scope"
 	"reflect"
-	"rt2/context"
-	"rt2/frame"
-	"rt2/nodeframe"
-	"rt2/scope"
 	"ypk/assert"
 )
 

+ 5 - 5
rt2/rules/return.go

@@ -1,13 +1,13 @@
 package rules
 
 import (
-	"cp/node"
 	"fmt"
+	"fw/cp/node"
+	"fw/rt2/context"
+	"fw/rt2/frame"
+	"fw/rt2/nodeframe"
+	"fw/rt2/scope"
 	"reflect"
-	"rt2/context"
-	"rt2/frame"
-	"rt2/nodeframe"
-	"rt2/scope"
 )
 
 func returnSeq(f frame.Frame) (frame.Sequence, frame.WAIT) {

+ 6 - 6
rt2/rules/table.go

@@ -2,14 +2,14 @@
 package rules
 
 import (
-	"cp/node"
 	"fmt"
+	"fw/cp/node"
+	"fw/rt2/context"
+	"fw/rt2/decision"
+	"fw/rt2/frame"
+	"fw/rt2/nodeframe"
+	"fw/rt2/scope"
 	"reflect"
-	"rt2/context"
-	"rt2/decision"
-	"rt2/frame"
-	"rt2/nodeframe"
-	"rt2/scope"
 )
 
 func prologue(n node.Node) frame.Sequence {

+ 3 - 3
rt2/scope/area.go

@@ -1,9 +1,9 @@
 package scope
 
 import (
-	"cp/node"
-	"cp/object"
-	"rt2/context"
+	"fw/cp/node"
+	"fw/cp/object"
+	"fw/rt2/context"
 )
 
 //менеджер зон видимости, зоны видимости динамические, создаются в момент входа в EnterNode

+ 4 - 4
rt2/scope/stdScope.go

@@ -2,12 +2,12 @@ package scope
 
 import (
 	"container/list"
-	"cp/node"
-	"cp/object"
 	"fmt"
+	"fw/cp/node"
+	"fw/cp/object"
+	"fw/rt2/context"
+	rt_mod "fw/rt2/module"
 	"reflect"
-	"rt2/context"
-	rt_mod "rt2/module"
 	"ypk/assert"
 )
 

+ 1 - 1
xev/cmds.go

@@ -1,8 +1,8 @@
 package xev
 
 import (
-	"cp/module"
 	"fmt"
+	"fw/cp/module"
 	"io/ioutil"
 	"path/filepath"
 )

+ 7 - 7
xev/converter.go

@@ -1,14 +1,14 @@
 package xev
 
 import (
-	"cp/constant"
-	"cp/constant/enter"
-	"cp/constant/operation"
-	"cp/module"
-	"cp/node"
-	"cp/object"
-	"cp/statement"
 	"fmt"
+	"fw/cp/constant"
+	"fw/cp/constant/enter"
+	"fw/cp/constant/operation"
+	"fw/cp/module"
+	"fw/cp/node"
+	"fw/cp/object"
+	"fw/cp/statement"
 	"math/big"
 	"strconv"
 	"unicode/utf16"

+ 0 - 21
ypk/assert/debug.go

@@ -1,21 +0,0 @@
-package assert
-
-import (
-	"fmt"
-)
-
-func For(cond bool, code int) {
-	e := fmt.Sprint(code)
-	if !cond {
-		switch {
-		case (code >= 20) && (code < 40):
-			e = fmt.Sprintln(code, "precondition violated")
-		case (code >= 40) && (code < 60):
-			e = fmt.Sprintln(code, "subcondition violated")
-		case (code >= 60) && (code < 80):
-			e = fmt.Sprintln(code, "postcondition violated")
-		default:
-		}
-		panic(e)
-	}
-}