Commits

Liam Staskawicz  committed d7b01fd

* rename CodeWScope to Code

  • Participants
  • Parent commits 0e8dff6

Comments (0)

Files changed (3)

File fan/bson/BsonReader.fan

         // case BsonType.REGEX.val:
         // case BsonType.CODE.val:
         case Bson.CODE_W_SCOPE:
-          remaining = readCodeWScope(ins, remaining, bson)
+          remaining = readCode(ins, remaining, bson)
         case Bson.NUMBER_LONG:
           remaining = readLong(ins, remaining, bson)
         case Bson.NUMBER_INT:
     return remaining - (name.size + 1 + objlen)
   }
   
-  static private Int readCodeWScope(InStream ins, Int remaining, Str:Obj? bson)
+  static private Int readCode(InStream ins, Int remaining, Str:Obj? bson)
   {
     name := readCStr(ins)
     totalsize := ins.readS4()
     ins.skip(1) // eat the null terminator...worth validating that this is 0?
     scope := Str:Obj?[:] { ordered = true }
     readObject(ins, scope)
-    bson[name] = CodeWScope(code, scope)
+    bson[name] = Code(code, scope)
     return remaining - (name.size + 1 + totalsize)
   }
   

File fan/bson/BsonWriter.fan

     else if (val is List) writeArray(b, key, val)
     else if (val is Bool) writeBool(b, key, val)
     else if (val is Map) writeMap(b, key, val)
-    else if (val is CodeWScope) writeCodeWScope(b, key, val)
+    else if (val is Code) writeCode(b, key, val)
     // else if (val is Regex) writeRegex(out, key, val)
     else throw Err("unknown BSON type - can't serialize ${Type.of(val).qname}")
   }
     oid.write(b.out)
   }
   
-  private static Void writeCodeWScope(Buf b, Str key, CodeWScope cws)
+  private static Void writeCode(Buf b, Str key, Code cws)
   {
     b.write(Bson.CODE_W_SCOPE)
     writeCStr(b.out, key)

File fan/bson/CodeWScope.fan

 
 
 **
-**  CodeWScope
+**  Code
 **
-class CodeWScope 
+class Code 
 {
   const Str code
   const Str:Obj? scope