Well, I got to the point where all the bultins, library modules etc. are compiling and the unit tests are being executed.
The latest stopping point is the following:
<HUGE SNIP>
E.................
=============================Parsing==========================
#
# MessagingTest: Tests for Reia's asynchronous messaging
# Copyright (C)2010 Tony Arcieri
#
# Redistribution is permitted under the MIT license. See LICENSE for details.
#
module MessagingTest
def run
[messaging_test()]
end
def messaging_test
# FIXME: this test could use some work
TestHelper.expect("Messaging", "works") do
# Send ourselves a message
Process.pid() ! (:theanswer, 42)
receive
when (:theanswer, answer)
(42, answer)
end
end
end
end
--------------------------------------------------------------
{{line,8},{column,1}} : got token 'module'
{{line,8},{column,8}} : got token '"Mod:MessagingTest"'
{{line,9},{column,3}} : got token 'def'
{{line,9},{column,7}} : got token '"ID:run"'
{{line,10},{column,6}} : got token '"ID:messaging_test"'
{{line,10},{column,6}} : got token '"ID:messaging_test"'
{{line,10},{column,23}} : got token 'eol'
{{line,11},{column,3}} : got token ''end''
{{line,13},{column,3}} : got token 'def'
{{line,13},{column,7}} : got token '"ID:messaging_test"'
{{line,15},{column,5}} : got token '"Mod:TestHelper"'
{{line,15},{column,5}} : got token '"Mod:TestHelper"'
{{line,15},{column,16}} : got token '"ID:expect"'
{{line,15},{column,45}} : got token 'do'
{{line,17},{column,7}} : got token '"Mod:Process"'
{{line,17},{column,7}} : got token '"Mod:Process"'
{{line,17},{column,15}} : got token '"ID:pid"'
{{line,17},{column,7}} : got token '"Mod:Process"'
{{line,17},{column,7}} : got token '"Mod:Process"'
{{line,17},{column,24}} : got token '":theanswer"'
{{line,17},{column,24}} : got token '":theanswer"'
{{line,17},{column,36}} : got token '"int:42"'
{{line,17},{column,36}} : got token '"int:42"'
{{line,17},{column,39}} : got token 'eol'
{{line,19},{column,7}} : got token ''receive''
{{line,20},{column,7}} : got token ''when''
{{line,20},{column,13}} : got token '":theanswer"'
{{line,20},{column,13}} : got token '":theanswer"'
{{line,20},{column,25}} : got token '"ID:answer"'
{{line,20},{column,25}} : got token '"ID:answer"'
{{line,20},{column,25}} : got token '"ID:answer"'
{{line,20},{column,25}} : got token '"ID:answer"'
{{line,20},{column,32}} : got token 'eol'
{{line,21},{column,10}} : got token '"int:42"'
{{line,21},{column,10}} : got token '"int:42"'
{{line,21},{column,14}} : got token '"ID:answer"'
{{line,21},{column,14}} : got token '"ID:answer"'
{{line,21},{column,14}} : got token '"ID:answer"'
{{line,21},{column,14}} : got token '"ID:answer"'
{{line,21},{column,21}} : got token 'eol'
{{line,22},{column,7}} : got token ''end''
{{line,19},{column,7}} : got token ''receive''
{{line,22},{column,10}} : got token 'eol'
{{line,23},{column,5}} : got token ''end''
{{line,15},{column,5}} : got token '"Mod:TestHelper"'
{{line,15},{column,5}} : got token '"Mod:TestHelper"'
{{line,23},{column,8}} : got token 'eol'
{{line,24},{column,3}} : got token ''end''
{{line,25},{column,1}} : got token ''end''
{{line,8},{column,1}} : got token 'module'
----------Parse finished : Result--------
[{module,8,'MessagingTest',
[{function,9,run,[],
{var,1,'_'},
[{cons,10,{local_call,10,messaging_test,[],{nil,1}},{empty,10}}]},
{function,13,messaging_test,[],
{var,1,'_'},
[{remote_call,15,
{module_name,15,'TestHelper'},
expect,
[{string,15,"Messaging"},{string,15,"works"}],
{lambda,15,[],
[{send,17,
{remote_call,17,
{module_name,17,'Process'},
pid,[],
{nil,1}},
{tuple,17,[{atom,17,theanswer},{integer,17,42}]}},
{'receive',19,
[{clause,20,
[{tuple,20,
[{atom,20,theanswer},{var,20,answer}]}],
[{tuple,21,[{integer,21,42},{var,21,answer}]}]}],
[]}]}}]}]}]
----------- End of Parse Result ---------
EE
\n'List retrieves the nth element correctly' FAILED\nexpected true, actual false\n\n'List replaces elements in pattern matching expressions ' FAILED\nexpected [1,42,69], actual 69\n\n'List replaces elements in complex pattern matching expressions ' FAILED\nexpected [8,9,10,4], actual 10\n\n'Tuple retrieves the nth element correctly' FAILED\nexpected true, actual false\n\n'Tuple replaces elements in pattern matching expressions ' FAILED\nexpected (1,42,69), actual 69\n\n'Tuple replaces elements in complex pattern matching expressions ' FAILED\nexpected (8,9,10,4), actual 10\n\n'String inspects properly' FAILED\nexpected \""foobar"\", actual \"\"foobar\"\"\n\n'Dict gets values by key' FAILED\nexpected \"bar\", actual {:foo=>\"bar\"}\n\n'Dict casts to a string' FAILED\nexpected \"{:foo=>"bar"}\", actual \"{:foo=>\"bar\"}\"\n\n'Dict inspects properly' FAILED\nexpected \"{:foo=>"bar"}\", actual \"{:foo=>\"bar\"}\"\n\nbuiltins/
atom.re ERROR: SyntaxError: /home/graeme/projects/reia/test/builtins/
atom_test.re:8: Parse error near "module AtomTest" (Column: 1)\n\tfrom Object: in 'call'
\tfrom JsonParser: in 'transform'
\tfrom JsonParser: in '-transform/2-lc$^0/1-0-'
\tfrom JsonTest: in '-list_test/2-fun-0-'
\tfrom TestHelper: in 'expect'
\tfrom JsonTest: in 'run'
\tfrom /home/graeme/projects/reia/test/runner: in '-toplevel/0-fun-0-'
\tfrom lists: in 'map'\n\ncore/
object.re ERROR: SyntaxError: /home/graeme/projects/reia/test/core/
object_test.re:30: Parse error near "module ObjectTest" (Column: 1)\n\tfrom Object: in 'call'
\tfrom JsonParser: in 'transform'
\tfrom JsonParser: in '-transform/2-lc$^0/1-0-'
\tfrom JsonTest: in '-list_test/2-fun-0-'
\tfrom TestHelper: in 'expect'
\tfrom JsonTest: in 'run'
\tfrom /home/graeme/projects/reia/test/runner: in '-toplevel/0-fun-0-'
\tfrom lists: in 'map'\n\ncore/
messaging.re ERROR: (:case_clause,[])\n\nlib/
json.re ERROR: badarg\n\nexception error: bad argument in an arithmetic expression
in function 'TestHelper':duration/2
in call from '/home/graeme/projects/reia/test/runner':toplevel/0
in call from reia_bytecode:load/2
in call from reia_internal:execute_file/1
in call from init:start_it/1
in call from init:start_em/1
I spot a fondness for the third element of everything in the FAILED messages there. Could we be generating bad executable code?
I post this here purely as an interesting exercise for the reader - just in case anything obvious leaps out.
I have pretty much convinced myself that I need to hack up a way to send each of the *.re modules to the current parser and the PEG and compare the outputs. It is probably quicker in the long run than investigating individual problems, and it will give a much higher level of confidence in the end.
Unless you think otherwise?
g