bpo-42986: Fix parser crash when reporting syntax errors in f-string with newlines (GH-24279)

diff --git a/Lib/test/test_fstring.py b/Lib/test/test_fstring.py
index 7ca1512..d7143d1 100644
--- a/Lib/test/test_fstring.py
+++ b/Lib/test/test_fstring.py
@@ -664,6 +664,9 @@ def test_parens_in_expressions(self):
         self.assertAllRaise(SyntaxError, 'unterminated string literal',
                             ["f'{\n}'",
                              ])
+    def test_newlines_before_syntax_error(self):
+        self.assertAllRaise(SyntaxError, "invalid syntax",
+                ["f'{.}'", "\nf'{.}'", "\n\nf'{.}'"])
 
     def test_backslashes_in_string_part(self):
         self.assertEqual(f'\t', '\t')