Skip to content

Commit

Permalink
Add a version of Erlang parser that injects Erlson at parse time
Browse files Browse the repository at this point in the history
This is the first step in making Erlson work from Erlang shell.
  • Loading branch information
alavrik committed Jul 9, 2011
1 parent 3a888a1 commit 17efac2
Show file tree
Hide file tree
Showing 4 changed files with 1,115 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ebin
*.beam *.beam
*.P *.P
src/erl_parse.erl src/erl_parse.erl
src/erl_parse_shell.erl


# vim: # vim:
*.swp *.swp
2 changes: 1 addition & 1 deletion src/Makefile
Original file line number Original file line Diff line number Diff line change
@@ -1,4 +1,4 @@
ERL_SOURCES = erl_parse.erl erlson_pt.erl erlson.erl ERL_SOURCES = erl_parse.erl erl_parse_shell.erl erlson_pt.erl erlson.erl
ERL_TESTS = erlson_tests.erl ERL_TESTS = erlson_tests.erl
TEST = erlson_tests TEST = erlson_tests


Expand Down
2 changes: 2 additions & 0 deletions src/erl_parse.yrl
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -352,10 +352,12 @@ record_expr -> expr_max '#' record_tuple :
{record,?line('$2'),'$1','','$3'}. {record,?line('$2'),'$1','','$3'}.
record_expr -> record_expr '#' atom '.' atom : record_expr -> record_expr '#' atom '.' atom :
{record_field,?line('$2'),'$1',element(3, '$3'),'$5'}. {record_field,?line('$2'),'$1',element(3, '$3'),'$5'}.
% XXX: is this useful? include anyway for completeness?
record_expr -> record_expr '.' atom : record_expr -> record_expr '.' atom :
{record_field,?line('$2'),'$1','','$3'}. {record_field,?line('$2'),'$1','','$3'}.
record_expr -> record_expr '#' atom record_tuple : record_expr -> record_expr '#' atom record_tuple :
{record,?line('$2'),'$1',element(3, '$3'),'$4'}. {record,?line('$2'),'$1',element(3, '$3'),'$4'}.
% XXX: is this useful? include anyway for completeness?
record_expr -> record_expr '#' record_tuple : record_expr -> record_expr '#' record_tuple :
{record,?line('$2'),'$1','','$3'}. {record,?line('$2'),'$1','','$3'}.


Expand Down
Loading

0 comments on commit 17efac2

Please sign in to comment.