diff --git a/.idea/dictionaries/project.xml b/.idea/dictionaries/project.xml new file mode 100644 index 0000000..74199c4 --- /dev/null +++ b/.idea/dictionaries/project.xml @@ -0,0 +1,8 @@ + + + + cmplx + hashalg + + + \ No newline at end of file diff --git a/pkg/core/vals/cvls/a.go b/pkg/core/vals/cvls/a.go index a887fd1..1f32ee7 100644 --- a/pkg/core/vals/cvls/a.go +++ b/pkg/core/vals/cvls/a.go @@ -85,8 +85,12 @@ type ( uints interface { uint | uint8 | uint16 | uint32 | uint64 | uintptr | HashAlg } - cmplx interface{ complex64 | complex128 } - lists interface{ Bytes | Stack } + cmplx interface{ + complex64 | complex128 + } + lists interface{ + Bytes | Stack + } ) var ( @@ -96,7 +100,6 @@ var ( ErrInvalidCValueForType = Module.MustCode("invalid_value_for_type") uuidZero = UUID{} - bigZero = big.NewInt(0) specs = newSpecInfos() @@ -130,7 +133,6 @@ var ( "uuid", "date", - "bigInt", "reflect", "object", diff --git a/pkg/core/vals/cvls/cfield.go b/pkg/core/vals/cvls/cfield.go index aa3afdb..874cc59 100644 --- a/pkg/core/vals/cvls/cfield.go +++ b/pkg/core/vals/cvls/cfield.go @@ -118,10 +118,6 @@ func MakeCFieldDuration(name string, val Duration, attr CFieldAttr) CField { return CField{name: name, CValue: MakeCValueDuration(val), CFieldAttr: attr} } -func MakeCFieldBigInt(name string, val *BigInt, attr CFieldAttr) CField { - return CField{name: name, CValue: MakeCValueBigInt(val), CFieldAttr: attr} -} - func MakeCFieldBytes(name string, val Bytes, attr CFieldAttr) CField { return CField{name: name, CValue: MakeCValueBytes(val), CFieldAttr: attr} } diff --git a/pkg/core/vals/cvls/cfield_attr.go b/pkg/core/vals/cvls/cfield_attr.go index e1c74fe..726337d 100644 --- a/pkg/core/vals/cvls/cfield_attr.go +++ b/pkg/core/vals/cvls/cfield_attr.go @@ -70,8 +70,12 @@ const ( // NoFieldAttr es el atributo por defecto — Public + Plain + NoBehavior. const NoFieldAttr CFieldAttr = 0 + type CFieldAttr uint16 + + + // Visibility devuelve el grupo de visibilidad del atributo. func (a CFieldAttr) Visibility() CFieldVisibility { return CFieldVisibility(a & maskVisibility) diff --git a/pkg/core/vals/cvls/cvalue.go b/pkg/core/vals/cvls/cvalue.go index 6126370..a2d249d 100644 --- a/pkg/core/vals/cvls/cvalue.go +++ b/pkg/core/vals/cvls/cvalue.go @@ -52,7 +52,6 @@ package cvls import ( "core/errs" "math" - "math/big" "time" "unsafe" ) @@ -125,23 +124,6 @@ func MakeCValueComplex128(val complex128) CValue { return makeCComplex[complex128](val, KindComplex128) } -func MakeCValueBigInt(val *BigInt) CValue { - if val == nil { - return CValue{Spec: makeSpecScalar(KindBigInt), State: StateNil} - } - if val.Cmp(bigZero) == 0 { - return CValue{Spec: makeSpecScalar(KindBigInt), State: StateZero} - } - - if val.IsInt64() { - return CValue{ - Spec: makeSpecScalar(KindBigInt), - State: StateVersion, - intVal: val.Int64(), - } - } - return CValue{Spec: makeSpecScalar(KindBigInt), anyVal: val} -} func MakeCValueBytes(val Bytes) CValue { if val == nil { @@ -265,8 +247,6 @@ func (v CValue) Value() any { val, _ = v.AsUUID() case KindDate: val, _ = v.AsDate() - case KindBigInt: - val, _ = v.AsBigInt() case KindReflect: val, _ = v.AsReflect() case KindPackable: @@ -436,21 +416,6 @@ func (v CValue) AsDate() (Date, bool) { return time.Unix(0, v.intVal).UTC(), true } -func (v CValue) AsBigInt() (*BigInt, bool) { - if v.ValueKind() != KindBigInt { - return nil, false - } - if v.HasZero() { - return big.NewInt(0), true - } - if v.IsDefer() { - return v.anyVal.(func() *BigInt)(), true - } - if v.HasVersion() { - return big.NewInt(v.intVal), true - } - return v.anyVal.(*BigInt), true -} func (v CValue) AsReflect() (Reflect, bool) { return asCValueFromAny[Reflect](v, KindReflect) } diff --git a/pkg/core/vals/cvls/kind.go b/pkg/core/vals/cvls/kind.go index e76fd57..70daf99 100644 --- a/pkg/core/vals/cvls/kind.go +++ b/pkg/core/vals/cvls/kind.go @@ -85,7 +85,6 @@ const ( /* Structs */ KindDate - KindBigInt KindReflect KindObject diff --git a/pkg/core/vals/cvls/spec_infos.go b/pkg/core/vals/cvls/spec_infos.go index 22f17e5..3e93fd9 100644 --- a/pkg/core/vals/cvls/spec_infos.go +++ b/pkg/core/vals/cvls/spec_infos.go @@ -93,7 +93,6 @@ func newSpecInfos() *specInfos { ti.specs[KindUUID] = makeSpecInfo[UUID](KindUUID, true, MakeCValueUUID) ti.specs[KindDate] = makeSpecInfo[Date](KindDate, true, MakeCValueDate) - ti.specs[KindBigInt] = makeSpecInfo[BigInt](KindBigInt, true, MakeCValueBigInt) ti.specs[KindObject] = makeSpecInfo[any](KindObject, true, makeCValueCObject) ti.specs[KindReflect] = makeSpecInfo[Reflect](KindReflect, true, MakeCValueReflect) @@ -164,8 +163,6 @@ func (i *specInfos) createCValue(value any) CValue { case Date: return i.specs[KindDate].valMaker(value) - case BigInt: - return i.specs[KindBigInt].valMaker(value) case Reflect: return i.specs[KindReflect].valMaker(value) @@ -394,27 +391,23 @@ func reflectKindToKind(kind reflect.Kind, val any) Kind { default: // todo debe de contemplar los tipos base switch val.(type) { - case Duration: - return KindDuration - case BigInt: - return KindBigInt - case HashAlg: + case Duration : return KindDuration + case HashAlg : return KindHashAlg - case UUID: - return KindUUID - case Bytes: + case UUID : return KindUUID + case Bytes : return KindBytes - case Stack: + case Stack : return KindStack - case Date: + case Date : return KindDate - case Reflect: + case Reflect : return KindReflect - case Packable: + case Packable : return KindPackable - case Stringer: + case Stringer : return KindStringer - case error: + case error : return KindError } return KindAny diff --git a/pkg/tests/core/vals/all.gos b/pkg/tests/core/vals/all.gos new file mode 100644 index 0000000..e69de29