diff --git a/src/compiler/crystal/syntax/parser.cr b/src/compiler/crystal/syntax/parser.cr index da2a6b7a4f42..569bbd4d9409 100644 --- a/src/compiler/crystal/syntax/parser.cr +++ b/src/compiler/crystal/syntax/parser.cr @@ -2117,7 +2117,7 @@ module Crystal raise "invalid regex: #{regex_error}", location end - result = RegexLiteral.new(result, options) + result = RegexLiteral.new(result, options).at(location) else # no special treatment end