Commit Graph

60 Commits

Author SHA1 Message Date
Torsten Rüger d1f8733623 Rename Vool to Sol
Simple is really the descriptive name for the layer
Sure, it is "virtual" but that is not as important as the fact that it is simple (or simplified)
Also objct (based really) is better, since orientated implies it is a little like that, but only orientated, not really it. Sol only has objects, nothing else
Just cause i was renaming anyway
2019-10-04 00:38:47 +03:00
Torsten Rüger c43436f35a Change Mom to SlotMachine
rather large commit, but essentially a simple rename
Rationale in docs and blogs
2019-10-03 20:55:41 +03:00
Torsten Rüger fd8a3e9cc5 some cc driven cleanup
bit anoying that the builtin engine is used
Even it is not as well configurable as preferred reek.
Still, found one minor bug
2019-10-02 17:54:42 +03:00
Torsten Rüger 3df54910cc rename singleton_class to single_class and misc
was clashing with real ruby method name
also many superclass mismatch fixes
some misc
2019-09-24 17:25:19 +03:00
Torsten Rüger 113ba8607c fix to_s (mostly) 2019-09-19 20:48:21 +03:00
Torsten Rüger 1a096110a8 basic require_relative (hack)
opted to hack require to be getting on
need require for the test helper
and the files in lib/parfait

General require mechanism would still be ok, but require_ralative means implementing file source, which needs to be dragged around. I'll make an issue
2019-09-07 22:13:53 +03:00
Torsten Rüger 2c681bf2e5 Add mom boot options
and remove a lot of stale parfait boots from tests
(from before using rubyxc)
2019-09-07 16:43:47 +03:00
Torsten Rüger 363d1cb36f fix module handling at ruby level
Was returning arrays instead of Statements, which messed things up
2019-09-06 21:00:37 +03:00
Torsten Rüger f126aa52df Descope Parfait in the compiler
Compiler now removes the module Parfait scope
and also the ::Parfait:: Scope in module names
Which means we can compile scoped code
and get unscoped code. for Parfait
Handy for tests too
2019-09-06 13:59:33 +03:00
Torsten Rüger b9bdc55059 A good start on the macro idea
I call it macro because it lets you insert basically arbitrary risc code into the ruby level. The way it works:
Reserve namespace X
map any X.some_call to a Mom instruction
by the name SomeCall
which must take the same args in constructor as given
And obviously produce whatever risc it wants
Hoping to rewrite builtin around this idea (with the existing Mom builtn instructions)
2019-08-25 14:40:59 +03:00
Torsten Rüger 57b0ad2c32 Fix super as statement
Super is a statement, a send really.
Not an expression (as maybe in c++)
The actual implementation will be a bit tricky, like raise, a bit of stack walking, but not impossible. Still, later
2019-08-19 18:48:13 +03:00
Torsten Rüger 0e694a38f7 Implicit returns for class methods
gets us parsing of parfaits second file data_object
2019-08-19 15:56:15 +03:00
Torsten Rüger 3ddf2e3837 Redoing ruby block conversion
Since the block is actually a constant, it does not need assignment or special hoisting
Just use the send and stick the lambda in as last arg
2019-08-19 14:23:55 +03:00
Torsten Rüger f87526f86f Renaming Vool exppressions rightly
Class, Method and Lambda (was block) are expressions.
Just making things clearer, especially for the blocks (ahem, lambdas) is matters.
wip
2019-08-19 11:33:12 +03:00
Torsten Rüger ae16551ed0 Rename Vool Block to Lambda
Making the distinction clearer
Some fixing of previous (wip)
2019-08-19 10:40:22 +03:00
Torsten Rüger 02807cf6f9 Rename Block to RubyBlock at Ruby level
The parser presents the whole call that defines the block as a block. And so does the Ruby layer, as we don't want to do processing in ast.
Just making it clearer, also Vool:: block will have to be renamed
2019-08-19 10:31:11 +03:00
Torsten Rüger 32f908c127 Adding simple implicit return
Ruby return semantics are easy to grasp, not so easy to code. So many cases.
Added support for common cases, return const/variable or call.
2019-08-17 23:27:55 +03:00
Torsten Rüger d3f3c91ae5 Fix all but one test
Riples upon riples. The one left looks like the genuine article
2019-08-16 21:43:54 +03:00
Torsten Rüger 7c91a08d5b Fix vool assignments after call rework
also small fix for if and return, as they need to execute sneds and yields (not just sends), so testing for Call not SendStatement
2019-08-16 20:39:08 +03:00
Torsten Rüger e6c30d98fb Fix if statements hoisting, now that send is working
Same same, just have to remembe to actually execute the condition if it is a send
Having send a possible expression, removes one tmp variable and associated move, for a little extra work.
Next return and assign (rest)
2019-08-16 18:42:57 +03:00
Torsten Rüger dee1e24c28 Fix ruby receiver to vool
for chained calls to be normalized correctly
2019-08-16 16:05:45 +03:00
Torsten Rüger c213cf874b Fix ruby normalising to_vool
So that vool layer never has complex conditions or returns
Start with while, next if, return and assign
2019-08-16 14:20:06 +03:00
Torsten Rüger 84b9811e55 Fixing ruby send with arguments
When send has complex args, mostly more sends, we hoist those out and pass created temporary variables
2019-08-15 21:30:36 +03:00
Torsten Rüger d3ed29520e Some docs 2019-08-06 17:42:15 +03:00
Torsten Ruger 1391667f6c still doing attr_reader, but closing #25
cattr still missing, but only one occurence. Later.
2019-03-07 11:00:18 +02:00
Torsten Ruger 5ed6a07083 better test for attr
still #25
2019-03-07 10:47:48 +02:00
Torsten Ruger 04720d4950 implement attr setter correctly
part of #25
still need to do for list and attr_reader
2019-03-06 11:21:09 +02:00
Torsten Ruger b4b1e6e13b start rewriting for parfait #25
just some infrastructure for now.
2019-03-05 20:36:40 +02:00
Torsten Ruger 11c5389e24 Fix if logic error
ifs may have an empty true block
Especially for unlesses thet is normal, so allow
2019-03-05 20:30:24 +02:00
Torsten Ruger 8d4eab72bf update parser to use 2.6
was choking on &. syntax
improved error reporting slightly
2019-03-04 19:00:47 +02:00
Torsten Ruger eec72a9fca Successfully interpret class methods
just about closes #24
2019-02-27 09:48:21 +02:00
Torsten Ruger 40581494de class Methods down to vool #24 2019-02-14 19:24:12 +02:00
Torsten Ruger 37571a0ff9 Add ruby class methods
Ruby parser and ruby level for #24
2019-02-12 22:36:37 +02:00
Torsten Ruger 403540b3ca slightly better messages for unsupported ruby
Very slightly unfortunately, just just enought to find the error.
Also testing what is unsupported, so it's documented.
2019-02-10 21:02:16 +02:00
Torsten Ruger d73e1526cd Some docs and to_s testing
somewhat code_climate inspired
2018-09-01 15:54:25 +03:00
Torsten Ruger 2bb6ad5f61 remove unused code
Arrays and Hashes have to resolve to object creation calls
Not to constants. In the future off course
2018-09-01 15:14:07 +03:00
Torsten Ruger 4fe0edd1e3 first risc level block test working
assign was not executing yield
baecause it was just testing for send, instead of callable
2018-07-30 20:11:52 +03:00
Torsten Ruger 198a43cc8d rename callable to CallStatement
Callable is the Method, whereas here we call the method
2018-07-30 14:44:14 +03:00
Torsten Ruger 700744e6d5 block assignment ruby to vool 2018-07-25 11:06:42 +03:00
Torsten Ruger b6c85cd4a4 callable as base for yield and send
more yield tests
2018-07-21 14:34:39 +03:00
Torsten Ruger 6022aa4dab introduce ruby variable and remove ct_type
cleaner oo
2018-07-20 20:53:35 +03:00
Torsten Ruger 235853ab2d first run at ruby block to_vool
leaving the parser structure in the ruby layer,
but adopting the constant approach in vool
2018-07-20 20:07:15 +03:00
Torsten Ruger 0238874c20 fx ruby send args 2018-07-20 20:06:14 +03:00
Torsten Ruger d03592dfb1 fix ruby return 2018-07-20 20:05:32 +03:00
Torsten Ruger 172327f045 fix assignments
which was letting ruby instances through
also rename the doubious copy
2018-07-20 18:13:58 +03:00
Torsten Ruger 6a58a71c0a fix while.to_vool
sanitize normalizer on the way
- return ruby, let caller to_vool
- return single statement, not single? statements
2018-07-20 17:51:17 +03:00
Torsten Ruger 9b8bd57db4 fix if to_vool
and add (simple) hoisting tests
2018-07-20 17:30:08 +03:00
Torsten Ruger 98788b52d3 fix ruby variables 2018-07-20 14:22:26 +03:00
Torsten Ruger f4402ba30f fix local assignment
was missing a method that got lost in copy/paste
also renaming to get guard to pick up tests
2018-07-20 14:16:29 +03:00
Torsten Ruger d14eca3e70 fix assignments to_vool 2018-07-20 13:43:37 +03:00