Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 53c4b1e9d5a9
Choose a base ref
...
head repository: crystal-lang/crystal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 25f8c255e4fd
Choose a head ref
  • 2 commits
  • 2 files changed
  • 2 contributors

Commits on May 2, 2018

  1. raise syntax error when using out as a varname

    that fixes #6042
    esse committed May 2, 2018
    Copy the full SHA
    f6f20be View commit details
  2. Merge pull request #6052 from esse/out_syntax_error

    Raise syntax error when using out as an arg
    asterite authored May 2, 2018
    Copy the full SHA
    25f8c25 View commit details
Showing with 3 additions and 3 deletions.
  1. +2 −2 spec/compiler/parser/parser_spec.cr
  2. +1 −1 src/compiler/crystal/syntax/parser.cr
4 changes: 2 additions & 2 deletions spec/compiler/parser/parser_spec.cr
Original file line number Diff line number Diff line change
@@ -172,13 +172,13 @@ describe "Parser" do
assert_syntax_error "def foo!=; end", "unexpected token: !="
assert_syntax_error "def foo?=(x); end", "unexpected token: ?"

# #5895
# #5895 & #6042
%w(
begin nil true false yield with abstract
def macro require case select if unless include
extend class struct module enum while until return
next break lib fun alias pointerof sizeof
instance_sizeof typeof private protected asm
instance_sizeof typeof private protected asm out
end
).each do |kw|
assert_syntax_error "def foo(#{kw}); end", "cannot use '#{kw}' as an argument name", 1, 9
2 changes: 1 addition & 1 deletion src/compiler/crystal/syntax/parser.cr
Original file line number Diff line number Diff line change
@@ -3672,7 +3672,7 @@ module Crystal
:def, :macro, :require, :case, :select, :if, :unless, :include,
:extend, :class, :struct, :module, :enum, :while, :until, :return,
:next, :break, :lib, :fun, :alias, :pointerof, :sizeof,
:instance_sizeof, :typeof, :private, :protected, :asm,
:instance_sizeof, :typeof, :private, :protected, :asm, :out,
# `end` is also invalid because it maybe terminate `def` block.
:end
true