Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve two errors #7542

Merged
merged 7 commits into from
May 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/compiler/parser/parser_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ module Crystal
assert_syntax_error "case when .foo? then 1; end"
assert_syntax_error "macro foo;{%end};end"
assert_syntax_error "foo {1, 2}", "unexpected token: ,"
assert_syntax_error "pointerof(self)", "can't take pointerof(self)"
assert_syntax_error "pointerof(self)", "can't take address of self"
assert_syntax_error "def foo 1; end"

assert_syntax_error %<{"x": [] of Int32,\n}\n1.foo(>, "unterminated call", 3, 6
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/crystal/syntax/parser.cr
Original file line number Diff line number Diff line change
Expand Up @@ -5364,7 +5364,7 @@ module Crystal
next_token_skip_space_or_newline

if @token.keyword?(:self)
raise "can't take pointerof(self)", @token.line_number, @token.column_number
raise "can't take address of self", @token.line_number, @token.column_number
end

exp = parse_op_assign
Expand Down