Ver Fonte

тест на логику

kpmy há 10 anos atrás
pai
commit
63f8bdfeba
6 ficheiros alterados com 9 adições e 5 exclusões
  1. BIN
      code/XevInit.oz
  2. BIN
      code/XevTest0.oz
  3. BIN
      code/XevTest1.oz
  4. BIN
      code/XevTest2.oz
  5. 2 5
      rt2/rules/op.go
  6. 7 0
      rt2/scope/modern/val.go

BIN
code/XevInit.oz


BIN
code/XevTest0.oz


BIN
code/XevTest1.oz


BIN
code/XevTest2.oz


+ 2 - 5
rt2/rules/op.go

@@ -87,14 +87,11 @@ func mopSeq(f frame.Frame) (seq frame.Sequence, ret frame.WAIT) {
 	case operation.NOT:
 		switch n.Left().(type) {
 		case node.ConstantNode:
-			//			rt2.DataOf(f)[n.Left()] = n.Left().(node.ConstantNode).Data()
-			panic(0)
+			rt2.ValueOf(f)[n.Left().Adr()] = sc.Provide(n.Left())(nil)
 			return op, frame.NOW
 		case node.VariableNode, node.ParameterNode:
 			seq = func(f frame.Frame) (seq frame.Sequence, ret frame.WAIT) {
-				//				sc := f.Domain().Discover(context.SCOPE).(scope.Manager)
-				//				rt2.DataOf(f)[n.Left()] = sc.Select(scope.Designator(n.Left()))
-				panic(0)
+				rt2.ValueOf(f)[n.Left().Adr()] = sc.Select(n.Left().Object().Adr())
 				return op, frame.NOW
 			}
 			ret = frame.NOW

+ 7 - 0
rt2/scope/modern/val.go

@@ -1312,6 +1312,13 @@ func (o *ops) Neq(a, b scope.Value) scope.Value {
 				default:
 					panic(fmt.Sprintln(reflect.TypeOf(y)))
 				}
+			case BOOLEAN:
+				switch y := b.(type) {
+				case BOOLEAN:
+					return BOOLEAN(x != y)
+				default:
+					panic(fmt.Sprintln(reflect.TypeOf(y)))
+				}
 			default:
 				panic(fmt.Sprintln(reflect.TypeOf(x)))
 			}