[svn:parrot] r46171 - branches/codestring/src/pmc

coke at svn.parrot.org coke at svn.parrot.org
Fri Apr 30 03:50:37 UTC 2010


Author: coke
Date: Fri Apr 30 03:50:37 2010
New Revision: 46171
URL: https://trac.parrot.org/parrot/changeset/46171

Log:
passing codetest

Modified:
   branches/codestring/src/pmc/codestring.pmc
   branches/codestring/src/pmc/string.pmc

Modified: branches/codestring/src/pmc/codestring.pmc
==============================================================================
--- branches/codestring/src/pmc/codestring.pmc	Fri Apr 30 03:48:43 2010	(r46170)
+++ branches/codestring/src/pmc/codestring.pmc	Fri Apr 30 03:50:37 2010	(r46171)
@@ -132,15 +132,13 @@
             /* remaining string can be added as is. */
             VTABLE_push_string(INTERP, strings,
                 Parrot_str_substr(INTERP, fmt, pos,
-                    Parrot_str_byte_length(INTERP, fmt) -pos 
-                )
-            );
+                    Parrot_str_byte_length(INTERP, fmt) -pos));
             break;
-        } else {
+        }
+        else {
             /* slurp up the to just before the % sign... */
             VTABLE_push_string(INTERP, strings,
-                key = Parrot_str_substr(INTERP, fmt, pos, percentPos - pos)
-            );
+                key = Parrot_str_substr(INTERP, fmt, pos, percentPos - pos));
             /* skip the % sign */
             pos = percentPos + 1 ;
         }
@@ -150,29 +148,24 @@
 
         if (VTABLE_exists_keyed_str(INTERP, hash, key)) {
             VTABLE_push_string(INTERP, strings,
-                    VTABLE_get_string_keyed_str(INTERP, hash, key)
-            );
+                    VTABLE_get_string_keyed_str(INTERP, hash, key));
         }
         else if (Parrot_str_is_cclass(INTERP, enum_cclass_numeric, key, 0)) {
             VTABLE_push_string(INTERP, strings,
                 VTABLE_get_string_keyed_int(INTERP, args,
-                    Parrot_str_to_int(INTERP, key)
-                )
-            );
+                    Parrot_str_to_int(INTERP, key)));
         }
         else if (Parrot_str_equal(INTERP, key, comma)) {
             INTVAL num_args = VTABLE_elements(INTERP, args);
             INTVAL pos_args = 1;
 
-            VTABLE_push_string(INTERP, strings, 
-                VTABLE_get_string_keyed_int(INTERP, args, 0)
-            );
+            VTABLE_push_string(INTERP, strings,
+                VTABLE_get_string_keyed_int(INTERP, args, 0));
 
             while (pos_args < num_args) {
                 VTABLE_push_string(INTERP, strings, comma_space);
-                VTABLE_push_string(INTERP, strings, 
-                    VTABLE_get_string_keyed_int(INTERP, args, pos_args)
-                );
+                VTABLE_push_string(INTERP, strings,
+                    VTABLE_get_string_keyed_int(INTERP, args, pos_args));
                 pos_args++;
             }
         }
@@ -182,8 +175,7 @@
         else {
             /* %foo has no special meaning, pass it through unchanged */
             VTABLE_push_string(INTERP, strings,
-                key = Parrot_str_substr(INTERP, fmt, pos-2, 2)
-            );
+                key = Parrot_str_substr(INTERP, fmt, pos-2, 2));
         }
     }
 
@@ -209,7 +201,7 @@
         PMC *strings;
         INTVAL elements;
         STRING *result;
-       
+
         GET_ATTR_strings(INTERP, SELF, strings);
         elements = VTABLE_elements(INTERP, strings);
 

Modified: branches/codestring/src/pmc/string.pmc
==============================================================================
--- branches/codestring/src/pmc/string.pmc	Fri Apr 30 03:48:43 2010	(r46170)
+++ branches/codestring/src/pmc/string.pmc	Fri Apr 30 03:50:37 2010	(r46171)
@@ -92,7 +92,7 @@
 
     VTABLE INTVAL get_integer() {
         STRING *str_val;
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -112,7 +112,7 @@
 
     VTABLE FLOATVAL get_number() {
         STRING *str_val;
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -132,7 +132,7 @@
 
     VTABLE STRING *get_string() {
         STRING *str_val;
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -152,7 +152,7 @@
 
     VTABLE INTVAL get_bool() {
         STRING *str_val;
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -218,7 +218,7 @@
             Parrot_str_free_cstring(copy);
         }
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             SET_ATTR_str_val(INTERP, SELF, value);
         else
             SELF.set_string_native(value);
@@ -235,7 +235,7 @@
 */
 
     VTABLE void assign_string_native(STRING *value) {
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             SET_ATTR_str_val(INTERP, SELF, value);
         else
             SELF.set_string_native(value);
@@ -268,7 +268,7 @@
     VTABLE INTVAL is_equal(PMC *value) {
         STRING *str_val;
         STRING * const v = VTABLE_get_string(INTERP, value);
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -296,7 +296,7 @@
         FLOATVAL       sf;
         const FLOATVAL vf = VTABLE_get_number(INTERP, value);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -320,7 +320,7 @@
         STRING *str_val;
         STRING * const v = VTABLE_get_string(INTERP, value);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -343,7 +343,7 @@
         STRING *str_val;
         STRING * const v = VTABLE_get_string(INTERP, value);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -367,7 +367,7 @@
         FLOATVAL       sf;
         const FLOATVAL vf = VTABLE_get_number(INTERP, value);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -398,7 +398,7 @@
         STRING        *str_val;
         STRING * const v = VTABLE_get_string(INTERP, value);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -419,7 +419,7 @@
     VTABLE void substr(INTVAL offset, INTVAL length, PMC *dest) {
         STRING *str_val, *s2;
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -441,7 +441,7 @@
     VTABLE STRING *substr_str(INTVAL offset, INTVAL length) {
         STRING *str_val;
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -465,7 +465,7 @@
         INTVAL       n;
         const INTVAL k = VTABLE_get_integer(INTERP, key);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -505,7 +505,7 @@
     VTABLE STRING *get_string_keyed_int(INTVAL pos) {
         STRING      *str_val;
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -520,7 +520,7 @@
     VTABLE INTVAL get_integer_keyed_int(INTVAL pos) {
         STRING      *str_val;
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -546,14 +546,14 @@
         STRING      *str_val;
         const INTVAL len = Parrot_str_byte_length(INTERP, value);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
 
         str_val = Parrot_str_replace(INTERP, str_val, pos, len, value);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             SET_ATTR_str_val(INTERP, SELF, str_val);
         else
             SELF.set_string_native(str_val);
@@ -567,14 +567,14 @@
         STRING      *str_val;
         STRING * const c = string_chr(INTERP, (UINTVAL) value);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
 
         str_val = Parrot_str_replace(INTERP, str_val, pos, 1, c);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             SET_ATTR_str_val(INTERP, SELF, str_val);
         else
             SELF.set_string_native(str_val);
@@ -699,7 +699,7 @@
     VTABLE INTVAL elements() {
         STRING *str_val;
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -730,7 +730,7 @@
         STRING *str_val;
         SUPER(info);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             GET_ATTR_str_val(INTERP, SELF, str_val);
         else
             str_val = SELF.get_string();
@@ -754,7 +754,7 @@
 
         str_val = VTABLE_shift_string(INTERP, info);
 
-        if (SELF->vtable->base_type == enum_class_String) 
+        if (SELF->vtable->base_type == enum_class_String)
             SET_ATTR_str_val(INTERP, SELF, str_val);
         else
             SELF.set_string_native(str_val);


More information about the parrot-commits mailing list