Skip to content
This repository
Browse code

Minor fix

  • Loading branch information...
commit 6f5204f5a38b55dd8f7f37c72088e652e417ac6c 1 parent 83a32b6
nineties authored
8 rowl1/rowl1-compile.rlc
@@ -2,7 +2,7 @@
2 2 ; rowl - 1st generation
3 3 ; Copyright (C) 2010 nineties
4 4 ;
5   -; $Id: rowl1-compile.rlc 2013-03-17 16:46:41 nineties $
  5 +; $Id: rowl1-compile.rlc 2013-03-19 17:22:33 nineties $
6 6 ;
7 7
8 8 (import "rlvm-compile")
@@ -23,6 +23,12 @@
23 23 (var noguard (to_sym "%noguard"))
24 24 (var closed (to_sym "%closed"))
25 25
  26 +(export fun unwrap_internal (node) (
  27 + (if (== (node_head node) Ref)
  28 + (return (unwrap_internal (node_arg node 2))))
  29 + (return node)
  30 + ))
  31 +
26 32 ; compilers
27 33
28 34 (extern object current_loc)
8 rowl1/rowl1-pprint.rlc
@@ -2,7 +2,7 @@
2 2 ; rowl - 1st generation
3 3 ; Copyright (C) 2012 nineties
4 4 ;
5   -; $Id: rowl1-array.rlc 2013-03-05 07:02:27 nineties $
  5 +; $Id: rowl1-array.rlc 2013-03-19 17:26:12 nineties $
6 6 ;
7 7
8 8 (import "rlvm-compile")
@@ -47,9 +47,10 @@
47 47 ))
48 48
49 49 (fun pprint_main (ochan obj) (
  50 + (= obj (unwrap_internal obj))
50 51 (tswitch (node_type obj) (
51 52 (@SymbolE . (return (output_symbol ochan obj)))
52   - (@ExprE . (return (pp_expr ochan obj)))
  53 + (@ExprE . (return (pp_node ochan obj)))
53 54 (@ListE . (return (pp_list ochan obj)))
54 55 (@ArrayE . (return (pp_array ochan obj)))
55 56 (@TableE . (return (pp_table ochan obj)))
@@ -130,7 +131,8 @@
130 131 (return @C_NIL)
131 132 ))
132 133
133   -(fun pp_expr (ochan node) (
  134 +(extern fun unwrap_internal)
  135 +(fun pp_node (ochan node) (
134 136 (output_symbol ochan (node_head node))
135 137 (output_char ochan '{')
136 138 (var n (node_size node))
13 rowl1/rowl1-tuple.rlc
@@ -2,7 +2,7 @@
2 2 ; rowl - 1st generation
3 3 ; Copyright (C) 2010 nineties
4 4 ;
5   -; $Id: rowl1-list.rlc 2013-02-06 23:09:39 nineties $
  5 +; $Id: rowl1-list.rlc 2013-03-19 11:49:08 nineties $
6 6 ;
7 7
8 8 (import "rlvm-compile")
@@ -54,6 +54,15 @@
54 54 (return t)
55 55 ))
56 56
  57 +(fun tp_new (n) (
  58 + (= n (unbox n))
  59 + (var t (allocate_tuple n))
  60 + (for i 0 n (do
  61 + (array_set object t i @C_UNDEF)
  62 + ))
  63 + (return t)
  64 + ))
  65 +
57 66 (fun tp_length (t) (
58 67 (return (box (seq_size t)))
59 68 ))
@@ -139,6 +148,8 @@
139 148 ))
140 149
141 150 (export fun setup_tuple (std) (
  151 + (var mod (create_module std (to_sym "Tuple")))
  152 + (add_function1 mod (to_sym "new") intT tp_new 0)
142 153 (add_function1 std (to_sym "length") tupleT tp_length 0)
143 154 (add_function1 std (to_sym "size") tupleT tp_length 0)
144 155 (add_function1 std (to_sym "hash") tupleT tp_hash 0)

0 comments on commit 6f5204f

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