Skip to content

Commit

Permalink
support trailing comma in list
Browse files Browse the repository at this point in the history
>>> [1]
[1]
>>> [1,]
[1]
>>> [1,2]
[1,2]
>>> [1,2,]
[1,2]
  • Loading branch information
marianoguerra committed Sep 28, 2016
1 parent 16c7bd1 commit 3ed090a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/otl_parser.yrl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ list -> open_list close_list : {nil, line('$1')}.
list -> open_list list_items close_list : '$2'.

list_items -> literal : {cons, line('$1'), '$1', {nil, line('$1')}}.
list_items -> literal sep : {cons, line('$1'), '$1', {nil, line('$1')}}.
list_items -> literal sep list_items : {cons, line('$1'), '$1', '$3'}.
list_items -> literal cons_op literal : {cons, line('$1'), '$1', '$3'}.

Expand Down

0 comments on commit 3ed090a

Please sign in to comment.