瀏覽代碼

обновил компиляты, добавил код парсера json, отладил аллокатор для рекордов

kpmy 10 年之前
父節點
當前提交
225e7d6f6b
共有 18 個文件被更改,包括 19 次插入6 次删除
  1. 二進制
      code/Cons.oz
  2. 二進制
      code/Console.oz
  3. 二進制
      code/JSonFormatter.oz
  4. 二進制
      code/JSonGenerator.oz
  5. 二進制
      code/JSonObxNoModel.oz
  6. 二進制
      code/JSonParser.oz
  7. 二進制
      code/Mathe.oz
  8. 二進制
      code/Out.oz
  9. 二進制
      code/Start3.oz
  10. 二進制
      code/Str.oz
  11. 二進制
      code/TestA0.oz
  12. 二進制
      code/TestA1.oz
  13. 二進制
      code/TestA2.oz
  14. 二進制
      code/TestMath.oz
  15. 二進制
      code/TestStrDyn.oz
  16. 二進制
      code/TestStrings.oz
  17. 1 1
      rt2/rules/assign.go
  18. 18 5
      rt2/scope/modern/ms.go

二進制
code/Cons.oz


二進制
code/Console.oz


二進制
code/JSonFormatter.oz


二進制
code/JSonGenerator.oz


二進制
code/JSonObxNoModel.oz


二進制
code/JSonParser.oz


二進制
code/Mathe.oz


二進制
code/Out.oz


二進制
code/Start3.oz


二進制
code/Str.oz


二進制
code/TestA0.oz


二進制
code/TestA1.oz


二進制
code/TestA2.oz


二進制
code/TestMath.oz


二進制
code/TestStrDyn.oz


二進制
code/TestStrings.oz


+ 1 - 1
rt2/rules/assign.go

@@ -232,7 +232,7 @@ func assignSeq(f frame.Frame) (seq frame.Sequence, ret frame.WAIT) {
 				panic(0)
 			}))
 		} else {
-			//fmt.Println("NEW here")
+			//fmt.Println("NEW here", a.Left().Adr())
 			fn := heap.Allocate(a.Left())
 			sc.Update(a.Left().Object().Adr(), fn)
 			return frame.End()

+ 18 - 5
rt2/scope/modern/ms.go

@@ -116,7 +116,14 @@ func (l *level) alloc(d context.Domain, mod *cpm.Module, root node.Node, ol []ob
 					for rec := t; rec != nil; {
 						for x := rec.Link(); x != nil; x = x.Link() {
 							//fmt.Println(o.Name(), ".", x.Name(), x.Adr())
-							fl = append(fl, x)
+							switch x.(type) {
+							case object.FieldObject:
+								fl = append(fl, x)
+							case object.ParameterObject, object.ProcedureObject, object.VariableObject:
+								//do nothing
+							default:
+								halt.As(100, reflect.TypeOf(x))
+							}
 						}
 						if rec.BaseRec() == nil {
 							x := ml.NewTypeCalc()
@@ -142,11 +149,17 @@ func (l *level) alloc(d context.Domain, mod *cpm.Module, root node.Node, ol []ob
 			case object.TypeObject, object.ConstantObject, object.ProcedureObject, object.Module:
 				//do nothing
 			case object.ParameterObject:
-				if root.(node.EnterNode).Enter() == enter.PROCEDURE {
-					l.r[l.next] = newRef(x)
-					l.k[x.Adr()] = l.next
-					l.next++
+				switch r := root.(type) {
+				case node.EnterNode:
+					if r.Enter() == enter.PROCEDURE {
+						l.r[l.next] = newRef(x)
+						l.k[x.Adr()] = l.next
+						l.next++
+					}
+				default:
+					halt.As(100, reflect.TypeOf(r), x.Adr())
 				}
+
 			default:
 				halt.As(20, reflect.TypeOf(x))
 			}