diff options
| author | Kevin Newton <kddnewton@gmail.com> | 2024-06-11 08:24:43 -0400 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2024-06-11 12:34:00 +0000 |
| commit | 47322b592a0d75477a65e6e4ddaed2eb6549c32c (patch) | |
| tree | f9681b5f8517c799aa9014f1f7940bba81aac423 | |
| parent | d6b1822f22d12dcc772a4b3788bce08e4ba327d1 (diff) | |
[ruby/prism] Match CRuby error message for unknown regexp options
https://github.com/ruby/prism/commit/73669b59f6
| -rw-r--r-- | prism/templates/src/diagnostic.c.erb | 2 | ||||
| -rw-r--r-- | test/prism/errors_test.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/prism/templates/src/diagnostic.c.erb b/prism/templates/src/diagnostic.c.erb index f323a93fc8..1fc3e6047e 100644 --- a/prism/templates/src/diagnostic.c.erb +++ b/prism/templates/src/diagnostic.c.erb @@ -319,7 +319,7 @@ static const pm_diagnostic_data_t diagnostic_messages[PM_DIAGNOSTIC_ID_MAX] = { [PM_ERR_REGEXP_NON_ESCAPED_MBC] = { "/.../n has a non escaped non ASCII character in non ASCII-8BIT script: /%.*s/", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_REGEXP_INVALID_UNICODE_RANGE] = { "invalid Unicode range: /%.*s/", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_REGEXP_PARSE_ERROR] = { "%s", PM_ERROR_LEVEL_SYNTAX }, - [PM_ERR_REGEXP_UNKNOWN_OPTIONS] = { "unknown regexp %s: %.*s", PM_ERROR_LEVEL_SYNTAX }, + [PM_ERR_REGEXP_UNKNOWN_OPTIONS] = { "unknown regexp %s - %.*s", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_REGEXP_TERM] = { "unterminated regexp meets end of file; expected a closing delimiter", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_REGEXP_UTF8_CHAR_NON_UTF8_REGEXP] = { "UTF-8 character in non UTF-8 regexp: /%s/", PM_ERROR_LEVEL_SYNTAX }, [PM_ERR_RESCUE_EXPRESSION] = { "expected a rescued expression", PM_ERROR_LEVEL_SYNTAX }, diff --git a/test/prism/errors_test.rb b/test/prism/errors_test.rb index c995748083..91ba6ea373 100644 --- a/test/prism/errors_test.rb +++ b/test/prism/errors_test.rb @@ -2134,14 +2134,14 @@ module Prism def test_regular_expression_with_unknown_regexp_options source = "/foo/AZaz" - errors = [["unknown regexp options: AZaz", 4..9]] + errors = [["unknown regexp options - AZaz", 4..9]] assert_errors expression(source), source, errors end def test_interpolated_regular_expression_with_unknown_regexp_options source = "/\#{foo}/AZaz" - errors = [["unknown regexp options: AZaz", 7..12]] + errors = [["unknown regexp options - AZaz", 7..12]] assert_errors expression(source), source, errors end |
