Skip to content
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