Skip to content

Commit 16337b6

Browse files
committedNov 17, 2013
Cleanup grammar file
1 parent 2c9eb84 commit 16337b6

File tree

2 files changed

+1641
-1659
lines changed

2 files changed

+1641
-1659
lines changed
 

Diff for: ‎lib/opal/parser/grammar.rb

+1,628-1,644
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: ‎lib/opal/parser/grammar.y

+13-15
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ rule
702702
{
703703
result = val[1]
704704
}
705-
| none_block_pass
705+
| # none
706706
{
707707
result = nil
708708
}
@@ -1518,7 +1518,14 @@ xstring_contents: none
15181518
result = s(:args)
15191519
}
15201520

1521-
f_norm_arg: tCONSTANT
1521+
f_norm_arg: f_bad_arg
1522+
| tIDENTIFIER
1523+
{
1524+
result = val[0].intern
1525+
scope.add_local result
1526+
}
1527+
1528+
f_bad_arg: tCONSTANT
15221529
{
15231530
raise 'formal argument cannot be a constant'
15241531
}
@@ -1534,11 +1541,6 @@ xstring_contents: none
15341541
{
15351542
raise 'formal argument cannot be a global variable'
15361543
}
1537-
| tIDENTIFIER
1538-
{
1539-
result = val[0].intern
1540-
scope.add_local result
1541-
}
15421544

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

1637-
assoc_list: none
1639+
assoc_list: # none
16381640
{
16391641
result = []
16401642
}
16411643
| assocs trailer
16421644
{
16431645
result = val[0]
16441646
}
1645-
| args trailer
1646-
{
1647-
raise "unsupported assoc list type (#@line_number)"
1648-
}
16491647

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

17001698
none: # none
1701-
1702-
none_block_pass: # none
1703-
1699+
{
1700+
result = nil
1701+
}
17041702
end
17051703

17061704
---- inner

0 commit comments

Comments
 (0)
Please sign in to comment.