public
Description: Convert Php to Ruby (Will soon die and be reborn as something different..)
Homepage: http://ionize.farleyknight.com
Clone URL: git://github.com/farleyknight/ionize.git
Click here to lend your support to: ionize and make a donation at www.pledgie.com !
ionize / History.txt
100644 96 lines (80 sloc) 2.519 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
* 0.2.0
  * We now have some basic functionality for running a Rack webserver.
    ... to be filled in..!
 
* 0.1.10
  * Transforms an oo variable variable assignment
# Whats a variable variable?
#
# In Php, you can do this:
    #
    # $var = "foo";
    # $obj->$var = "bar";
    #
    # and this
    #
    # $obj->foo == "bar"
    #
    # would be true
    #
  * Transforms a while loop
  * Tranforms Php's destructuring bind
# http://us3.php.net/list
* Ruby2Ruby consumed a handful of files from PhpNuke
    without complaining..
 
* 0.1.9
  * Transformed a switch-case statement
  * Transformed Php's error guard, e.g. (@do_something_dangerous();)
into Ruby's error guard, e.g. do_something_dangerous() rescue nil
 
* 0.1.8
* Transformed entire class definition
 
* 0.1.7
  * Many of the stray :block nodes that I was encountering
    have now been fixed.. This let's it handle multiple
    if statements in one function body
 
* 0.1.6
* Foreach now transforms to an each loop
  * Array lookup
  * Single statement function
* If-else with nested if
 
* 0.1.5
* Passes tests for the conditional constructs:
    * If statements
    * If else statements
* Dangling else statements
* Basic boolean operators. Associativity is not quite
    correct, but will be fixed later.
  * String concatenation
* Array appending
* Increment (++) and decrement (--)
* For loops are unrolled to while loops with setup and update operations.
I might want to change this and use that fancy new Ruby macro
    library. I'm wondering how important it is for the PHP and Ruby code
    to look similiar to each other. This requires a bit more thought.
 
* 0.1.4
* Changed + and - to left associativity, fixing the problem
mentioned above
* Transformed function header with assigments, e.g.:
       add_column(&$ret, $attributes = array())
into
[:block,
[:args, :ret, :attributes,
[:block,
[:lasgn, :attributes,
[:fcall, :array]]]]]
 
The formal parameters of a function/method is probably
one of Ruby's more complicated ASTs
 
* 0.1.3
  * Transformed a slightly more complex function definition
    The operator associativity is not correct. It current is
    parsing:
       "$a + $b + $c"
    to
(a + (b + c))
    when it should be:
       ((a + b) + c)
 
* 0.1.2
  * Transformed simple function definition to ParseTree's
 
* 0.1.1
  * Transformed simple if statement to ParseTree's AST
 
* 0.1
  * Transformed "hello world" to ParseTree's AST