[svn:parrot] r48631 - in trunk: src/pmc t/pmc
plobsing at svn.parrot.org
plobsing at svn.parrot.org
Tue Aug 24 16:22:28 UTC 2010
Author: plobsing
Date: Tue Aug 24 16:22:28 2010
New Revision: 48631
URL: https://trac.parrot.org/parrot/changeset/48631
Log:
remove less than sane "sanity" check from LexInfo
check breaks encapsulation on Hash and prevents improvements to Hash freeze/thaw
Modified:
trunk/src/pmc/lexinfo.pmc
trunk/t/pmc/lexinfo.t
Modified: trunk/src/pmc/lexinfo.pmc
==============================================================================
--- trunk/src/pmc/lexinfo.pmc Tue Aug 24 16:13:32 2010 (r48630)
+++ trunk/src/pmc/lexinfo.pmc Tue Aug 24 16:22:28 2010 (r48631)
@@ -56,8 +56,7 @@
}
VTABLE void init() {
- Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
- "Cannot create a LexInfo PMC without an initializer");
+ SELF.init_pmc(PMCNULL);
}
VTABLE void init_pmc(PMC *sub) {
@@ -110,41 +109,6 @@
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
"Unknown introspection value '%S'", what);
}
-
-/*
-
-=item C<void visit(PMC *info)>
-
-=item C<void freeze(PMC *info)>
-
-=item C<void thaw(PMC *info)>
-
-Freeze/thaw interface used during freeze/thaw of the Sub PMC.
-The implementation of the Hash PMC is called.
-
-=cut
-
-*/
-
-
- VTABLE void thaw(PMC *info) {
- const INTVAL elems = VTABLE_shift_integer(INTERP, info);
- const INTVAL k_type = VTABLE_shift_integer(INTERP, info);
- const INTVAL v_type = VTABLE_shift_integer(INTERP, info);
- Hash *hash;
-
- UNUSED(k_type);
- UNUSED(v_type);
-
- PARROT_ASSERT(v_type == enum_hash_int);
- /* TODO make a better interface for hash creation
- * TODO create hash with needed types in the first place
- */
-
- SELF.init_pmc(NULL);
- hash = (Hash *)SELF.get_pointer();
- hash->entries = elems;
- }
}
Modified: trunk/t/pmc/lexinfo.t
==============================================================================
--- trunk/t/pmc/lexinfo.t Tue Aug 24 16:13:32 2010 (r48630)
+++ trunk/t/pmc/lexinfo.t Tue Aug 24 16:22:28 2010 (r48631)
@@ -19,23 +19,11 @@
.sub main :main
.include 'test_more.pir'
- plan(4)
+ plan(3)
- new_test()
inspect_test()
.end
-.sub new_test
- push_eh eh
- $P0 = new ['LexInfo']
- pop_eh
- ok(0, "shouldn't be able to create a LexInfo without an initializer")
- goto end
-eh:
- ok(1, "can't create a LexInfo without an initializer")
-end:
-.end
-
.sub inspect_test
.lex "$a", $P0
.lex "$b", $P1
More information about the parrot-commits
mailing list