fix all the cases, much white noise, array to list, string to sym stuff

This commit is contained in:
Torsten Ruger
2015-09-19 14:53:30 +03:00
parent 3b0b91f2fb
commit 21b652456d
78 changed files with 690 additions and 559 deletions

View File

@ -2,9 +2,11 @@ class Foo < Object
ofthen(3 , var)
end
-- -- --
s(:list, [s(:class, "Foo",
s(:module, "Object"), [s(:call,
s(:name, "ofthen"),
s(:arguments,
s(:int, 3),
s(:name, "var")))])])
s(:expressions,
s(:class, :Foo,
s(:derives, :Object),
s(:call,
s(:name, :ofthen),
s(:arguments,
s(:int, 3),
s(:name, :var)))))

View File

@ -5,14 +5,18 @@ class Pifi
end
end
-- -- --
s(:list, [s(:class, "Pifi", nil, [s(:call,
s(:name, "ofthen"),
s(:arguments,
s(:int, 3),
s(:name, "var"))), s(:function, :int,
s(:name, "ofthen"),
s(:parameters,
s(:field, :int, :n),
s(:field, :ref, :m)),
s(:expressions,
s(:int, 44)))])])
s(:expressions,
s(:class, :Pifi,
s(:derives, nil),
s(:call,
s(:name, :ofthen),
s(:arguments,
s(:int, 3),
s(:name, :var))),
s(:function, :int,
s(:name, :ofthen),
s(:parameters,
s(:field, :int, :n),
s(:field, :ref, :m)),
s(:expressions,
s(:int, 44)))))

View File

@ -8,18 +8,21 @@ class Ifi
end
end
-- -- --
s(:list, [s(:class, "Ifi", nil, [s(:function, :int,
s(:name, "ofthen"),
s(:parameters,
s(:field, :int, :n)),
s(:expressions,
s(:if,
s(:condition,
s(:int, 0)),
s(:if_true,
s(:assign,
s(:name, "isit"),
s(:int, 42))),
s(:if_false, [s(:assign,
s(:name, "maybenot"),
s(:int, 667))]))))])])
s(:expressions,
s(:class, :Ifi,
s(:derives, nil),
s(:function, :int,
s(:name, :ofthen),
s(:parameters,
s(:field, :int, :n)),
s(:expressions,
s(:if,
s(:condition,
s(:int, 0)),
s(:if_true,
s(:assign,
s(:name, :isit),
s(:int, 42))),
s(:if_false, [s(:assign,
s(:name, :maybenot),
s(:int, 667))]))))))

View File

@ -1,7 +1,14 @@
class Foo < Object
int Foo.test()
int test()
43
end
end
-- -- --
{:expression_list=>[{:module_name=>"Foo", :derived_name=>s(:module, "Object"), :class_expressions=>[{:type=>"int", :receiver=>s(:module, "Foo"), :function_name=>s(:name, "test"), :parameter_list=>[], :expressions=>[s(:int, 43)], :end=>"end"}], :end=>"end"}]}
s(:expressions,
s(:class, :Foo,
s(:derives, :Object),
s(:function, :int,
s(:name, :test),
s(:parameters),
s(:expressions,
s(:int, 43)))))

View File

@ -4,8 +4,12 @@ class Foo
end
end
-- -- --
s(:list, [s(:class, "Foo", nil, [s(:module, "Boo", [s(:call,
s(:name, "funcall"),
s(:arguments,
s(:int, 3),
s(:name, "var")))])])])
s(:expressions,
s(:class, :Foo,
s(:derives, nil),
s(:module, :Boo,
s(:call,
s(:name, :funcall),
s(:arguments,
s(:int, 3),
s(:name, :var))))))

View File

@ -5,15 +5,18 @@ class Opers
end
end
-- -- --
s(:list, [s(:class, "Opers", nil, [s(:function, :int,
s(:name, "foo"),
s(:parameters,
s(:field, :int, :x)),
s(:expressions,
s(:name, "int"),
s(:assign,
s(:name, "abba"),
s(:int, 5)),
s(:operator, "+",
s(:name, "abba"),
s(:int, 5))))])])
s(:expressions,
s(:class, :Opers,
s(:derives, nil),
s(:function, :int,
s(:name, :foo),
s(:parameters,
s(:field, :int, :x)),
s(:expressions,
s(:name, :int),
s(:assign,
s(:name, :abba),
s(:int, 5)),
s(:operator, "+",
s(:name, :abba),
s(:int, 5))))))

View File

@ -2,4 +2,7 @@ class Foo
5
end
-- -- --
s(:list, [s(:class, "Foo", nil, [s(:int, 5)])])
s(:expressions,
s(:class, :Foo,
s(:derives, nil),
s(:int, 5)))