Permalink
Browse files

Interpret argument in 'f ()' as nil instead of nothing

  • Loading branch information...
bouk committed Nov 28, 2016
1 parent 246a9a8 commit 523c267020787c3545bd72f27362cf8727372c0d
Showing with 10 additions and 1 deletion.
  1. +9 −0 mrbgems/mruby-compiler/bintest/mrbc.rb
  2. +1 −1 mrbgems/mruby-compiler/core/parse.y
@@ -10,3 +10,12 @@
assert_equal "#{cmd('mrbc')}:#{a.path}:Syntax OK", result.chomp
assert_equal 0, $?.exitstatus
end
assert('parsing function with void argument') do
a, out = Tempfile.new('a.rb'), Tempfile.new('out.mrb')
a.write('f ()')
a.flush
result = `#{cmd('mrbc')} -c -o #{out.path} #{a.path} 2>&1`
assert_equal "#{cmd('mrbc')}:#{a.path}:Syntax OK", result.chomp
assert_equal 0, $?.exitstatus
end
@@ -2109,7 +2109,7 @@ primary : literal
}
| tLPAREN_ARG {p->lstate = EXPR_ENDARG;} rparen
{
$$ = 0;
$$ = new_nil(p);
}
| tLPAREN compstmt ')'
{

0 comments on commit 523c267

Please sign in to comment.