Skip to content

Commit

Permalink
Showing 2 changed files with 1,641 additions and 1,659 deletions.
3,272 changes: 1,628 additions & 1,644 deletions lib/opal/parser/grammar.rb

Large diffs are not rendered by default.

28 changes: 13 additions & 15 deletions lib/opal/parser/grammar.y
Original file line number Diff line number Diff line change
@@ -702,7 +702,7 @@ rule
{
result = val[1]
}
| none_block_pass
| # none
{
result = nil
}
@@ -1518,7 +1518,14 @@ xstring_contents: none
result = s(:args)
}

f_norm_arg: tCONSTANT
f_norm_arg: f_bad_arg
| tIDENTIFIER
{
result = val[0].intern
scope.add_local result
}

f_bad_arg: tCONSTANT
{
raise 'formal argument cannot be a constant'
}
@@ -1534,11 +1541,6 @@ xstring_contents: none
{
raise 'formal argument cannot be a global variable'
}
| tIDENTIFIER
{
result = val[0].intern
scope.add_local result
}

f_arg_item: f_norm_arg
{
@@ -1634,18 +1636,14 @@ xstring_contents: none
result = val[1]
}

assoc_list: none
assoc_list: # none
{
result = []
}
| assocs trailer
{
result = val[0]
}
| args trailer
{
raise "unsupported assoc list type (#@line_number)"
}

assocs: assoc
{
@@ -1698,9 +1696,9 @@ xstring_contents: none
| terms tSEMI

none: # none

none_block_pass: # none

{
result = nil
}
end

---- inner

0 comments on commit 16337b6

Please sign in to comment.