[svn:parrot] r46380 - branches/codestring/src/pmc
coke at svn.parrot.org
coke at svn.parrot.org
Fri May 7 03:19:11 UTC 2010
Author: coke
Date: Fri May 7 03:19:11 2010
New Revision: 46380
URL: https://trac.parrot.org/parrot/changeset/46380
Log:
move methods around
Modified:
branches/codestring/src/pmc/codestring.pmc
Modified: branches/codestring/src/pmc/codestring.pmc
==============================================================================
--- branches/codestring/src/pmc/codestring.pmc Fri May 7 03:09:53 2010 (r46379)
+++ branches/codestring/src/pmc/codestring.pmc Fri May 7 03:19:11 2010 (r46380)
@@ -8,8 +8,8 @@
=head1 DESCRIPTION
-C<CodeString> is a class intended to simplify the process of emitting code
-strings.
+C<CodeString> is a class intended to simplify the process of generating
+code strings.
The primary method for C<CodeString> objects is C<emit>, which appends a line
(or lines) of code to the string according to a format parameter. The line can
@@ -189,44 +189,6 @@
/*
-=item get_string()
-
-Stringify ourselves.
-
-=cut
-
-*/
-
-
- VTABLE STRING *get_string() {
- PMC *stringbuilder;
- STRING *result;
-
- GET_ATTR_stringbuilder(INTERP, SELF, stringbuilder);
- return VTABLE_get_string(INTERP, stringbuilder);
- }
-
-/*
-
-=item set_string_native()
-
-Save our value as a single entry in the StringBuilder.
-
-=cut
-
-*/
-
-
- VTABLE void set_string_native(STRING *value) {
- PMC *stringbuilder;
- STRING *result;
-
- GET_ATTR_stringbuilder(INTERP, SELF, stringbuilder);
- VTABLE_set_string_native(INTERP, stringbuilder, value);
- }
-
-/*
-
=item lineof(INTVAL pos)
Return the line number of the line at offset C<pos>. This code assumes that
@@ -442,6 +404,24 @@
RETURN(STRING *out);
}
+ /* Dispatch these VTABLE entries to our StringBuilder. */
+
+ VTABLE STRING *get_string() {
+ PMC *stringbuilder;
+ STRING *result;
+
+ GET_ATTR_stringbuilder(INTERP, SELF, stringbuilder);
+ return VTABLE_get_string(INTERP, stringbuilder);
+ }
+
+ VTABLE void set_string_native(STRING *value) {
+ PMC *stringbuilder;
+
+ GET_ATTR_stringbuilder(INTERP, SELF, stringbuilder);
+ VTABLE_set_string_native(INTERP, stringbuilder, value);
+ }
+
+
VTABLE void i_concatenate_str(STRING *value) {
PMC *stringbuilder;
GET_ATTR_stringbuilder(INTERP, SELF, stringbuilder);
More information about the parrot-commits
mailing list