Ruby 4.0 リファレンスマニュアル

instance method SyntaxError#path

path -> StringRuby 3.2 から[permalink][rdoc][edit]
() → String?

文法エラーがあったファイルのパスを返します。