Skip to content

Track compile errors #522

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

Merged
merged 1 commit into from
Jul 11, 2025
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
1 change: 1 addition & 0 deletions lib/syntax_tree/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2871,6 +2871,7 @@ def on_parse_error(error, *)
alias on_assign_error on_parse_error
alias on_class_name_error on_parse_error
alias on_param_error on_parse_error
alias compile_error on_parse_error

# :call-seq:
# on_period: (String value) -> Period
Expand Down
4 changes: 2 additions & 2 deletions test/parser_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def test_parses_ripper_methods

def test_errors_on_missing_token_with_location
error = assert_raises(Parser::ParseError) { SyntaxTree.parse("f+\"foo") }
assert_equal(2, error.column)
assert_equal(3, error.column)
end

def test_errors_on_missing_end_with_location
Expand All @@ -45,7 +45,7 @@ def test_errors_on_missing_regexp_ending
error =
assert_raises(Parser::ParseError) { SyntaxTree.parse("a =~ /foo") }

assert_equal(5, error.column)
assert_equal(6, error.column)
end

def test_errors_on_missing_token_without_location
Expand Down