Skip to content

Commit

Permalink
Reword
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypin committed Nov 29, 2021
1 parent 2522c1e commit 5737200
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/compiler/parser/parser_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -1122,7 +1122,7 @@ module Crystal
it_parses "$~ = 1", Assign.new("$~".var, 1.int32)

assert_syntax_error "$2147483648"
assert_syntax_error "$99999999999999999999999?", "Regex capture index 99999999999999999999999 doesn't fit in an Int32"
assert_syntax_error "$99999999999999999999999?", "Index $99999999999999999999999 doesn't fit in an Int32"

it_parses "foo /a/", Call.new(nil, "foo", regex("a"))
it_parses "foo(/a/)", Call.new(nil, "foo", regex("a"))
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 @@ -998,7 +998,7 @@ module Crystal
end
location = @token.location
index = value.to_i?
raise "Regex capture index #{value} doesn't fit in an Int32" unless index
raise "Index $#{value} doesn't fit in an Int32" unless index
node_and_next_token Call.new(Global.new("$~").at(location), method, NumberLiteral.new(index))
when :__LINE__
node_and_next_token MagicConstant.expand_line_node(@token.location)
Expand Down

0 comments on commit 5737200

Please sign in to comment.