Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
523c2670
Unverified
Commit
523c2670
authored
Nov 28, 2016
by
Bouke van der Bijl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interpret argument in 'f ()' as nil instead of nothing
parent
246a9a8a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
mrbgems/mruby-compiler/bintest/mrbc.rb
mrbgems/mruby-compiler/bintest/mrbc.rb
+9
-0
mrbgems/mruby-compiler/core/parse.y
mrbgems/mruby-compiler/core/parse.y
+1
-1
No files found.
mrbgems/mruby-compiler/bintest/mrbc.rb
View file @
523c2670
...
@@ -10,3 +10,12 @@ assert('Compiling multiple files without new line in last line. #2361') do
...
@@ -10,3 +10,12 @@ assert('Compiling multiple files without new line in last line. #2361') do
assert_equal
"
#{
cmd
(
'mrbc'
)
}
:
#{
a
.
path
}
:Syntax OK"
,
result
.
chomp
assert_equal
"
#{
cmd
(
'mrbc'
)
}
:
#{
a
.
path
}
:Syntax OK"
,
result
.
chomp
assert_equal
0
,
$?
.
exitstatus
assert_equal
0
,
$?
.
exitstatus
end
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
mrbgems/mruby-compiler/core/parse.y
View file @
523c2670
...
@@ -2109,7 +2109,7 @@ primary : literal
...
@@ -2109,7 +2109,7 @@ primary : literal
}
}
| tLPAREN_ARG {p->lstate = EXPR_ENDARG;} rparen
| tLPAREN_ARG {p->lstate = EXPR_ENDARG;} rparen
{
{
$$ =
0
;
$$ =
new_nil(p)
;
}
}
| tLPAREN compstmt ')'
| tLPAREN compstmt ')'
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment