Skip to content
This repository
Browse code

Fill in and correct the code in pmc_func for size.

  • Loading branch information...
commit 4a4fee1eb8c7ebcc2900420172d153cd022bf443 1 parent 09730b8
Jon Gentle authored November 26, 2010

Showing 1 changed file with 12 additions and 3 deletions. Show diff stats Hide diff stats

  1. 15  pmc_func.c
15  pmc_func.c
@@ -5,10 +5,19 @@
5 5
 #include "pmc_func.h"
6 6
 #include "interp.h"
7 7
 
  8
+void lorito_pmc_func(Lorito_Interp *interp, Lorito_Ctx *ctx, Lorito_Str *func)
  9
+{
  10
+  if (func == lorito_string(interp, 0, "size"))
  11
+  {
  12
+    lorito_pmc_func_size(interp, ctx);
  13
+  }
  14
+}
  15
+
8 16
 void
9 17
 lorito_pmc_func_size(Lorito_Interp *interp, Lorito_Ctx *ctx)
10 18
 {
11  
-  Lorito_PMC *source = lorito_pop_arg(ctx);
12  
-  lorito_clr_arg(ctx);
13  
-  lorit_push_arg(interp, ctx, source->size);
  19
+  Lorito_PMC *source = lorito_pop_arg(interp, ctx);
  20
+  lorito_clr_arg(interp, ctx);
  21
+  Lorito_PMC *size = lorito_box_int_new(interp, source->size);
  22
+  lorito_push_arg(interp, ctx, size);
14 23
 }

0 notes on commit 4a4fee1

Please sign in to comment.
Something went wrong with that request. Please try again.